Skip to content

Zhao-hangtian/magic-square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magic-square 幻方

v0.1 实现普通幻方完美幻方的检查,幻方的定义参考:

主要参考百度百科西塘沿河博客

A magic square is a n × n grid of numbers such that the sum of each row is equal, and equal to the sum of each column.
  4 9 2
  3 5 7
  8 1 6
Some definitions also require the sum along the main diagonals to add to the same total.

普通幻方定义为行、列、主、副对角线各数之和均相等。

完美幻方(完全幻方)定义为行、列、主、副对角线及泛对角线各数之和均相等。

Demo

img1 img2 img3 img4 img5

其他参考

Wiki

Jenny Kenkel 课件

知乎

About

magic square

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages