Skip to content
This repository

HTTPS clone URL

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

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 assets
Octocat-spinner-32 console
Octocat-spinner-32 limelight
Octocat-spinner-32 rails3
Octocat-spinner-32 vendor
Octocat-spinner-32 webrick
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.markdown
Octocat-spinner-32 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.