Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tic Tac Toe in Ruby - runs via console, Limelight, WEBrick, and Rails 3
Ruby JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
assets
console
limelight
rails3
vendor/tic_tac_toe_engine
webrick
.gitignore
README.markdown
Rakefile

README.markdown

Notes:

  • 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.