FPGA Plays Tic-Tac-Toe

As computers get more and more powerful and artificial intelligence algorithms improve, few games remain where the best humans can reliably beat their electronic counterparts. In chess this barrier was passed in 2005 with the last human win against a computer, and recently humans lost to computers at go. Simpler games like tic-tac-toe have been solved for all possible positions for a while now, so even a simple computer will always win or tie the game. But that doesn’t mean that there’s nothing left to learn about these games as [Hayden] demonstrates with this tic-tac-toe game built entirely on an FPGA.

[Hayden] is making this as part of a college course on digital design, so it really starts at first principles for working with FPGAs. It’s programmed in Verilog on a Basys 3 board, which also hosts the switches used as the game’s input and handles the VGA video output as well. The build uses state machines to keep track of the moves played on each of the squares, and another state machine to keep track of whether or not the current game has been won. If so, it highlights the winning moves in red, and stops taking further inputs until it is reset. Some more logic ties everything together along with a customized VGA driver to produce the entire gaming experience.

A game like tic-tac-toe is a great way to master the fundamentals of a system like this before moving on to more complex programs, especially on an FPGA platform that might handle a lot of the things we take for granted on more traditional computing systems, such as the video output. If you’re interested in taking more of a deep dive into the world of FPGAs, we published a primer about them a few years ago that will get you started.

Continue reading “FPGA Plays Tic-Tac-Toe”

Logic Via DNA

We often say you can make logic gates out of nearly anything. [Steve Mould] would agree as he just finished playing naughts and crosses (tic tac toe if you are an American) with a tray full of DNA. You can see the resulting game and how it works in the video below.

The use of DNA isn’t really significant as it simply implements a logic equation for each of the nine cells. So, for example, each cell is taken by an X (the DNA) only when certain other squares have been taken by O or not taken by O. So you essentially create an AND/OR gate using the state of each cell and its inverse.

Continue reading “Logic Via DNA”

A Robot Game To Open Your Hackerspace

It’s always good to welcome a new hackerspace to the fold, and thus we’re pleased to hear about the upcoming opening of Hackerspace Drenthe, on the north-eastern edge of the Netherlands. Starting a new space during a global pandemic is something of a feat. As part of their opening something is required to demonstrate a robot for the curious public, and what could be more accessible than a robot arm playing tic-tac-toe!

It would be correct to say that a robot moving blocks with precision is not necessarily a ground-breaking achievement, but in its purpose of providing eye-candy for a hackerspace opening while also serving as an experiment for some of the students from the school adjacent to the space it is a success. The interface is a pleasingly retro War Games style terminal, and the software is written in Python. For the curious all can be found on a GitHub repository, and should you be in that region of Europe you can find Hackerspace Drenthe in the Netherlands border town of Coevorden and attend their opening on the 2nd of April.

Continue reading “A Robot Game To Open Your Hackerspace”

A robot playing tic-tac-toe against a human

TICO Robot Plays Tic-Tac-Toe By Drawing On A Tiny Whiteboard

Tic-tac-toe (or “Noughts and Crosses”) is a game simple enough to implement in any computer system: indeed it’s often used in beginner’s programming courses. A more challenging project, and arguably more interesting and useful, is to make some kind of hardware that can play it in real life. [mircemk] built a simple yet elegant machine that can play tic-tac-toe against a human player in a way that looks quite similar to the way humans play against one another: by drawing.

The robot’s design and programming were developed at PlayRobotics, who named the project TICO. The mechanical parts are available as STL files, to be printed by any 3D printer, and a comprehensive manual explains how to assemble and program the whole thing. Since it’s all open source, anyone can build it from scratch and modify it to their liking. The pictures show the original design by PlayRobotics, while the video (embedded after the break) shows [mircemk]’s version, which includes a wooden frame that gives it a bit more presence.

Continue reading “TICO Robot Plays Tic-Tac-Toe By Drawing On A Tiny Whiteboard”

TOBOT Is Your Tic Tac Toe Opponent With A Bad Attitude

[3dprintedlife] is apparently a little bored. Instead of whiling away the time playing tic tac toe, he built an impressive tic tac toe robot named TOBOT. The robot uses a Rasberry Pi Zero and a Feather to control a two-axis robot arm that can draw the board and make moves using a pen. It also uses a simple computer vision system to look at the board to understand your move, and it has a voice too.

The other thing TOBOT has is a bad attitude. The robot wants to win. Badly. Check out the video below and you’ll see what we mean.

Continue reading “TOBOT Is Your Tic Tac Toe Opponent With A Bad Attitude”

Tic-Tac-Toe Implemented In Single Call To Printf()

[Nicholas Carlini] programmed a C implementation of two-player Tic Tac Toe, and he did it in a single call to printf(). The arguments for that single function call get mind-bendingly complex, so it may come as no surprise that it was written for The International Obfuscated C Code Contest (IOCCC).

Most of us are aware that printf() is one of those functions that is considerably more complex under the hood, and capable of far more, than it may appear to be. But did you know that it is capable of Turing-complete computation?

[Nicholas] clearly steps through the theory, so give it a read. In short, a maze of arguments handles the logic of the game while an embedded scanf() reads user input, and printing the game board is always preceded by an escape code to clear the screen.

[Nicholas] is certainly no stranger to in-depth understandings; we’ve seen his work before in demonstrating how to fool speech recognition with hidden commands, including a powerful example showing how two virtually identical-sounding audio files transcribe entirely differently.

Tic Tac Arduintoe Moves The Game To 4×4

We know you’re out there spending a lot more time with your loved ones, and appreciate that you may be running out of ways to keep everyone entertained. [Mukesh] dropped us a tip because he has the antidote to boredom — a new twist on that old chestnut, Tic Tac Toe.

Instead of the usual 3×3 configuration, [Mukesh] made the grid 4×4 so the game would be more engaging. Game play is otherwise the same — this Tic Tac Toe still results in a lot of draws, but they take longer and you can’t see them coming a mile away. What’s even more engaging is that you get to push clicky buttons that light up, and don’t have to draw a grid before every game.

Under the hood is an Arduino Uno that controls 16 push buttons and their corresponding RGB LEDs. Whoever goes first is blue, and player two gets pink. If you win, your color floods the board for a brief victory animation. If the game is a tie, the board turns red. We really like the printed two-piece buttons that house the LEDs and actuate the push buttons while keeping the two separate. Toe your way past the break to check out the build video.

Intrigued by the 4×4 version, but need a build that takes more time? Try building your TTT in TTL.

Continue reading “Tic Tac Arduintoe Moves The Game To 4×4”