A simple TicTacToe game with AngularJS

On June 16, 2013, in Javascript, by Anuj Gakhar

This weekend, I decided to do a little practice project with AngularJS. I made a TicTacToe Game.

Here are some notes about the game :-

  • It’s a two player game, human vs computer.
  • It uses NegaMax Search for computer moves.
  • There are no DOM updates from the Angular controller (best practice). The controller simply changes scope variables which are reflected in the DOM via bindings.
  • Made use of Angular two-way binding.

The code is available on Github for those who are interested. Here is a working demo available if you want to see it in action.

Disclaimer: This is purely a practice project and my first game project as well, so please don’t treat this as the best way to do this by any means.

References: Thanks to https://github.com/aglemann/tic-tac-toe for the help with the NegaMax Search algorithm.

If you spot a bug or want to suggest an improvement, let me know. Or better yet, fork it and send me a pull request 🙂

Tagged with:  

One Response to A simple TicTacToe game with AngularJS

  1. David Galvis says:

    Thank you for sharing this with us. I’ve been working hardly on a new multiplayer website called http://papergames.io build with AngularJS and NodeJS. You can play with a friend or versus the AI which uses MiniMax algorithm.

Leave a Reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 292 other subscribers

© 2011 Anuj Gakhar
%d bloggers like this: