Skip to Main Content
Tiny C Projects
book

Tiny C Projects

by Dan Gookin
December 2022
Beginner content levelBeginner
384 pages
10h 44m
English
Manning Publications
Content preview from Tiny C Projects

15 Tic-tac-toe

At the climax of the 1983 film WarGames, the computer that’s about to start World War III is directed to play a game of tic-tac-toe with itself. Recognizing that the game is silly because experienced players often end play in a draw, the computer determines that nuclear war is futile. It decides not to blow up the world. This conclusion should add some excitement to this chapter, because you can equate any game of tic-tac-toe—even one simulated on a computer—to nuclear war.

Game play for tic-tac-toe is simple. It’s easy to code. If you haven’t yet done so, now is the time to write your own version of the game. Of course, it’s made more complex when you consider such tasks as:

  • Coding a game loop

  • Programming turns for players ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Five Lines of Code

Five Lines of Code

Christian Clausen
Modern C

Modern C

Jens Gustedt
Effective C

Effective C

Robert C. Seacord
Extreme C

Extreme C

Kamran Amini

Publisher Resources

ISBN: 9781633439825Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link