So I recently started making Connect 4 in python, and something i found was this:
I have a variable
boardslots, and it is defined in main.py
Board.py contains the function which determines if you win, using the variable
boardslots from main.py
My problem is:
In the main game loop the
boardslots variable changes according to your move, but in Board.py it does not change, it does not update that variable in Board.py, but it does in main.py.
Does anyone know how to update a variable from main.py in another file? How to update a variable in main.py, and see those changes in another file?
Please give advice in the comment section, and if it really cant be done i will just move it to main.py