Skip to content

An algorithm to generate a grid with special proprieties

License

Notifications You must be signed in to change notification settings

AsrtoMichi/Magic_Grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Magic Grid

The program generates a grid whit a number of row like this:

1 3 5 7 9 11 13 15
2 3 6 7 10 11 14 15
4 5 6 7 12 13 14 15
8 9 10 11 12 13 14 15

By indicating the numbers of the lines where it is found, it is possible to find the number, thanks to the formula ∑ 2^ (here the number of columns from 0)

Example

Number: 11

0 - 1 3 5 7 9 11 13 15
1 - 2 3 6 7 10 11 14 15
2 - 4 5 6 7 12 13 14 15
3 - 8 9 10 11 12 13 14 15

Columns: 0, 1, 3
Number = 2^0 + 2^1 + 2^3 = 1 + 2 + 8 = 11

About

An algorithm to generate a grid with special proprieties

Resources

License

Stars

Watchers

Forks

Languages