-
-
Save 8th-Light-Blog/1054205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blog Title: Limelight Tutorial: Tic Tac Toe Example (Part 2) | |
Author: Paul Pagel | |
Date: September 29th, 2008 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main do | |
board do | |
cell :id => "cell_0_0" | |
cell :id => "cell_0_1" | |
cell :id => "cell_0_2" | |
cell :id => "cell_1_0" | |
cell :id => "cell_1_1" | |
cell :id => "cell_1_2" | |
cell :id => "cell_2_0" | |
cell :id => "cell_2_1" | |
cell :id => "cell_2_2" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main do | |
board do | |
3.times do |row| | |
3.times do |col| | |
cell :id => "cell_#{row}_#{col}" | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
board { | |
width 152 | |
height 152 | |
border_width 1 | |
border_color "black" | |
} | |
cell { | |
width 50 | |
height 50 | |
border_width 1 | |
border_color "black" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jruby -S limelight open . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir players |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Cell | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir spec/players |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: << File.expand_path(File.dirname(__FILE__) + "/../players") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") | |
require 'cell' | |
describe Cell do | |
include Cell | |
attr_accessor :id | |
it "should make first move an X" do | |
@id = "cell_0_0" | |
@cell_one = Limelight::Prop.new | |
@scene = MockScene.new | |
@scene.register("cell_0_0", @cell_one) | |
self.stub!(:scene).and_return(@scene) | |
mouse_clicked(nil) | |
@cell_one.text.should == "X" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment