Basic design of the game 4 in a row. There are two players, Player 1 has pieces 'x', Player 2 has pieces 'o'. Each turn the program asks where the player in which column he want to insert his piece, if it is an invalid column (out of the range 1-7) it asks again the question. Once entered a valid input, the program place the piece and prints the uploaded grid. If the game is over the program prints on the screen The winner player, otherwise the game continues with the initial question asked to the other player. In the case of a draw it just prints: "It's a draw" and quit.
fabio752 / 4_in_a_row Goto Github PK
View Code? Open in Web Editor NEWPlay against a friend for in a row