Next Jam starts in...

481 Jams
4907 Games
1239 Developers

437th

Theme: AI
September 9th 2023

1 Games

Game of Nim by ChatGPT (C64)
by
Play
Description
ChatGPT was given the following prompt: Write a game of Nim in C. It should be player vs. computer. Print out the board to stdout, then ask the player where to take. Then, have the computer make its move and update and print the board. Check win condition after each move. If the player or the computer takes the last piece, announce that they have lost. Add a title screen with the rules and an option to restart if the player wants it by entering y or n. If the answer is n, print out "This game was made by ChatGPT," and end the program. ChatGP’s answer: This code provides a simple text-based interface for the Nim game. Players take turns removing stones, and the game checks for a win condition after each move. Players have the option to restart the game or exit. There was one error in the code, the win/lose condition was printed the wrong way.