Grid pattern , Squares

satsuj06

New member
Joined
May 12, 2020
Messages
1
So, I was doing some coding stuff and run in some problems, so let's take this 6x6 grid. How can I make 26 into 2 . I want to take any number in any row and turn into first row equivalent number. It should work on any grid. I can solve this problem with while loop, but I do think there is some easy math solution to this.
0 1 2 3 4 5
6 7 8 9 10 11
12 13 14 15 16 17
18 19 20 21 22 23
24 25 26 27 28 29
30 31 32 33 34 35
 
Last edited:
When I saw "turn 26 into 2" my first thought was "divide by 13"! The numbers in the same column as 2 are 8, 14, 20, 26, and 32. To "turn" each of those "into 2" you divide by 4, 7, 10, 13, and 16, each 3 larger than the previous number. But I really don't understand what it is you are trying to do.
 
Top