Jump to ratings and reviews
Rate this book

The Computer Always Wins: A Playful Introduction to Algorithms through Puzzles and Strategy Games

Rate this book
In THE COMPUTER ALWAYS WINS, Elliot Lichtman will teach you some of computer science’s most powerful concepts in a refreshingly accessible way: exploring them through word games, board games, and strategy games you already know. Learn recursion by playing tic-tac-toe, efficient search through puzzle games like sudoku and Wordle, and machine learning by way of the playground classic rock-paper-scissors. Finish the book, and you’ll come away with not only a deeper understanding of these foundational programming techniques but also a new appreciation for the amazing feats that can be accomplished using simple, readable code.

200 pages, Paperback

Published April 29, 2025

2 people are currently reading
80 people want to read

About the author

ELLIOT LICHTMAN started teaching online classes in computer science when he was a freshman in high school. Small classes quickly grew into a series of larger and longer offerings, and from those, this book was born. Elliot is currently a sophomore at Yale University.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
9 (60%)
4 stars
4 (26%)
3 stars
1 (6%)
2 stars
1 (6%)
1 star
0 (0%)
Displaying 1 - 5 of 5 reviews
5 reviews
May 20, 2025
This book – written by college sophomore (!!) Elliot Lichtman – offers readers an exciting challenge: teach the computer to effectively play games like Connect Four, Wordle and Sudoku. Students immediately begin to see themselves as creators, not just consumers. And they start to understand that previously abstract programming concepts like conditionals and loops are actually powerful tools that can be used to accomplish some pretty magical tasks. Moreover, teaching programming through game design allows students to experiment, fail safely, and iterate, all key components of both coding and gameplay. This playful approach fosters resilience, systems thinking, and a deeper understanding of problem-solving processes. And the book is at the same time . . . fun! There are color drawings that explain the various games and their associated strategies, playful text descriptions that bring to life all the key concepts, and then tons of sample code both in the book and on the book’s companion website. For high school educators especially, this book offers a motivating way to get students to build computational thinking skills while having a great time doing it. I highly recommend.
1,592 reviews40 followers
August 18, 2025
I should have the computer develop an algorithm for how to rate this book when (a) you are blown away that a sophomore in college wrote it; (b) admire the concept of teaching coding via puzzles and strategy games; (c) appreciate the use of modeling followed by online exercises for the student to try; but (d) neither know anything about nor really care about coding

if you are a computer type, I recommend checking it out. Very fun idea, and as far as I can tell he's done a nice job of making it accessible.

Why did I pick up the book given non-interest in topic? In a hurry at the library, and the title caught my eye. And I do like his way of thinking (and writing) rigorously about the structure of games, consideration of tradeoffs (comprehensiveness vs. computing resources required, e.g.).
Profile Image for Noah King.
263 reviews7 followers
June 18, 2025
This was a fun departure into non-fiction. The author shows the reader how programmers teach computers by using examples like Sudoku, Tic-tac-toe, 2048, rock paper scissors, and other common games. By illustrating how we can teach computers to play (and win) these games, he shows by extension how coding and machine learning work in general. As a non-coder myself, I found it pretty interesting. =)
6 reviews
May 18, 2025
When you are ready to learn the true power of coding, THIS is the book. With entertaining and understandable examples, Lichtman teaches readers how to combine the building blocks of an introductory coding class into programs that deliver magical results. Let's be honest: no one is excited to code because they want to create loops and conditionals; middle school and high school students learn to code because they want their code to DO SOMETHING. Lichtman knows this, so he meets students where they are: teaching them to code by showing them how to craft programs that can play strategy games like rock-scissors-paper and Connect Four, and solve puzzles like Wordle. This is a great book for teachers who want to inspire their advanced middle and high school students, and a great book for middle and high school students who want to engage in an inspiring and engaging self-study adventure. (And the book website has tons of support materials like sample code, a place to ask questions, and even an online book club.) In short, a wonderful and engaging new resource for students who are ready to step beyond purely introductory coding concepts.
1 review
May 18, 2025
The absolute most fun, engaging, and informative read!! I've been in the math & computer science world since I was in elementary school and I have loved board games for as long as I can remember. I wish I had this book growing up; I cannot think of a better way to get enthusiastic kids engaged with the deeper aspects of theoretical computer science in such an accessible way. It is fun-loving, both in its colorful illustrations and conversational style.

This book is truly a game changer – I, at least, have never seen anything like it in math & cs literature for middle and high school students. Teaching exciting topics through familiar strategy games is brilliant, and a whole lot more likely to get engagement from students than the classic dense competition training books and AP study manuals. Awesome book! I can't recommend enough!!
Displaying 1 - 5 of 5 reviews

Can't find what you're looking for?

Get help and learn more about the design.