Problem ba)
Your goal in this function is to input three quantities:
\begin{itemize}
\item m (a positive whole number)
\item cell_num (a positive whole number)
\item the coordinate of the player as two separate values x_player and y_player
\end{itemize}
The function should output the row number and the column number as a tuple, (row, col)
I suggest working with some test values. For example, start off assuming the game window is 600 x 600. Assume we wish to have 10 cells in each row with a
total of 10 rows (remember, we are in a square system). Make up a coordinate within this window, identify intuitively what cell it should be in, and only then
begin formalizing your computations in terms of the variables provided. You may (or not) find it helpful to create additional variables throughout your coding
process to keep track of details. If you plan accordingly, this can be done in about 2-3 lines of code.
In [1]: def get_cell(m, cell_num, x_player, y_player):
import random
random.seed(18)
m = random.randint(300,500)
cell_num = random.randint(15,20)
x_player = random.random()*m
y_player = random.random()*m
get_cell(m, cell_num, x_player, y_player)
return (row, col)