I am using the Zelle Python graphics library and I need some help creating an algorithm to return a number to a list.
Basically, I have a 5x7 board divided into a grid of 100x100 pixels. This matches a list like 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|
I need an algorithm that would take the center point of the grid with the mouse and turn it into a number corresponding to the list. For example, the point (50.50) will return 0, and the point (150, 150) will return 6, etc.
Thanks so much for taking the time to help figure out this algorithm!
source share