Rewrite the return value(s) of game so that the csv files contain easily-parsable and usable information
You could see all of the possible states for a particular game by generating a range of numbers from 0 to the initial state.
For each possible state i, you could record “player_state_i” and “move_state_i” as columns in the .csv file. You can also record winning_player.
For instance, with 3 toothpicks, you would have 7 columns: player_state_3, move_state_3, player_state_2, move_state_2, player_state_1, move_state_1, and winning_player. (Please generate these in a for loop rather than hard-coding them.) If the state did not occur, you can put “none” in player_state_i and “0” in move_state_i.
Rewrite the return value(s) of
game
so that the csv files contain easily-parsable and usable informationYou could see all of the possible states for a particular game by generating a range of numbers from 0 to the initial state.
For each possible state i, you could record “player_state_i” and “move_state_i” as columns in the .csv file. You can also record winning_player.
For instance, with 3 toothpicks, you would have 7 columns: player_state_3, move_state_3, player_state_2, move_state_2, player_state_1, move_state_1, and winning_player. (Please generate these in a for loop rather than hard-coding them.) If the state did not occur, you can put “none” in player_state_i and “0” in move_state_i.