Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adds tentative show method.

  • Loading branch information...
commit 77b72a5933b6cdd41668e0f8ba76cb90a23da01d 1 parent e931e7b
@yokolet authored
Showing with 11 additions and 0 deletions.
  1. +1 −0  lib/turtle.rb
  2. +10 −0 test/canvas_test.rb
View
1  lib/turtle.rb
@@ -29,6 +29,7 @@ def initialize(canvas_size)
@orientation = NORTH
@footsteps = []
@canvas = Canvas.new(canvas_size)
+ @canvas.insert(Footstep.new(@row, @col))
end
def rt(degree)
View
10 test/canvas_test.rb
@@ -4,6 +4,7 @@
require 'contest'
require 'canvas'
require 'footstep'
+require 'turtle'
class CanvasTest < Test::Unit::TestCase
@@ -31,4 +32,13 @@ def teardown
@canvas.insert(Footstep.new(6, 1))
assert_equal(6, @canvas.footsteps.last.row)
end
+
+ test "canvas shows footsteps" do
+ turtle = Turtle.new(11)
+ turtle.rt(90)
+ turtle.fd(5)
+ turtle.rt(135)
+ turtle.fd(5)
+ turtle.canvas.show
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.