this post was submitted on 27 Jun 2025
781 points (98.8% liked)

Programmer Humor

24555 readers
1864 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 29 points 1 day ago (1 children)

This reminds me of one of my very first programs, a tic-tac-toe game I wrote in high school. It displayed hardcoded grids of Xs and Os and blanks very similar to what's shown here. This approach worked because of the much more limited move possibilities. The program could always win if it made the first move, and always win or tie if the human moved first, depending on if the human made mistakes. I wish I still had the code.

[–] [email protected] 17 points 1 day ago (3 children)

Did the program cheat? Tic tac toe is a tie if opponents play correctly.

[–] [email protected] 2 points 12 hours ago

I'm probably remembering it wrong, it was a long time ago. It definitely always either won or tied but could never lose, because it knew the right responses to every move. No, it didn't cheat lol.

[–] [email protected] 2 points 18 hours ago (1 children)

How do you define cheating in such a simple game?

[–] [email protected] 4 points 18 hours ago (1 children)

Placing moves in invalid locations, passing a turn, or making multiple moves on one turn?

[–] [email protected] 1 points 4 hours ago

There are no invalid locations in tic Tac toe, passing a turn provides no advantage, I suppose you could take extra turns to cheat.