Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Tic Tac Toe in Ruby - runs via console, Limelight, WEBrick, and Rails 3
branch: master
Failed to load latest commit information.
assets game now manages scoreboard and try again, new assets, all specs pass
console fixed spec, updated Rakefile
limelight upgraded mongo and bson to 1.1
rails3 use rails 3.0.9
vendor/tic_tac_toe_engine replaced CSV with YAML (so much better), improved scoreboard formatti…
.gitignore ignore .rvmrc
README.markdown use rails 3.0.9
Rakefile fixed spec, updated Rakefile



  • All implementations should run on any Ruby VM with exception to the Limelight version which needs to run on JRuby.

  • 4x4 board option requires MongoDB. To install, go here or if you have homebrew installed, type brew install mongodb

To run on console

type ruby console/lib/tic\_tac\_toe.rb from root directory.

Move positions for 3x3 are 0-8 from top-left to bottom-right. Move positions for 4x4 are 0-15 from top-left to bottom-right.

 0 | 1 | 2
 3 | 4 | 5
 6 | 7 | 8

 0 | 1 | 2 | 3
 4 | 5 | 6 | 7
 8 | 9 | 10| 11
 12| 13| 14| 15

To run on Limelight UI

type limelight open limelight/lib from root directory.

You must have the following installed:

  • JRuby 1.5.1 or greater
  • Limelight gem
  • Limelight binary (*.dmg, *.exe)

Visit Limelight's website for more information.

To run on WEBrick

type ruby webrick/lib/webrick\_ttt.rb from root directory.

Go to http://localhost:7546/

It supports simultaneous games via cookies.

To run on Rails 3

Navigate to the rails3 directory, and type rails server

You must have the following installed:

  • Ruby 1.8.7 or 1.9.2
  • rails gem

Go to http://localhost:3000/ unless otherwise noted

It supports simultaneous games via cookies.

Something went wrong with that request. Please try again.