Get the latest tech news

Making a tic-tac-toe game with ‘randomness’ using pure HTML and CSS


Everyone loves CSS! Continuing in my obsession, I have created a tictactoe game, with an option to have a CPU that plays randomly. This was made without any JavaScript, only HTML and CSS. In this blog post I discuss how I made it

Now for the real fun part, how to create a sophisticated AI bot to play in an evenly distributed ‘random’ manner. Another possible solution would have been to animate each section individually so it joins the end of the queue once it’s done, allowing each label to fully cross the button without ever leaving a gap. Given the advances in the CSS spec to add trigonometric and other mathematical functions, writing a full scientific calculator within reach.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of css

css

Photo of randomness

randomness

Photo of pure HTML

pure HTML

Related news:

News photo

New Magic for Animations in CSS

News photo

Old dogs, new CSS tricks

News photo

Animating Ptolemy's Equant with Python, SVG, and CSS