summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rubywarrior/ultimate-beginner/.profile9
-rw-r--r--rubywarrior/ultimate-beginner/README21
-rw-r--r--rubywarrior/ultimate-beginner/player.rb5
-rw-r--r--rubywarrior/ultimate-beginner/spec/player_spec.rb19
4 files changed, 54 insertions, 0 deletions
diff --git a/rubywarrior/ultimate-beginner/.profile b/rubywarrior/ultimate-beginner/.profile
new file mode 100644
index 0000000..e6aa88d
--- /dev/null
+++ b/rubywarrior/ultimate-beginner/.profile
@@ -0,0 +1,9 @@
+BAhvOhlSdWJ5V2Fycmlvcjo6UHJvZmlsZQ86EEB0b3dlcl9wYXRoSSIBpS9V
+c2Vycy9tby8ucnZtL2dlbXMvcnVieS0xLjkuMy1wMzkyQHJ1Ynktd2Fycmlv
+ci9nZW1zL3J1Ynl3YXJyaW9yLTAuMS4zL3Rvd2Vycy9Vc2Vycy9tby8ucnZt
+L2dlbXMvcnVieS0xLjkuMy1wMzkyQHJ1Ynktd2Fycmlvci9nZW1zL3J1Ynl3
+YXJyaW9yLTAuMS4zL3Rvd2Vycy9iZWdpbm5lcgY6BkVUOhJAd2Fycmlvcl9u
+YW1lSSINdWx0aW1hdGUGOwdUOgtAc2NvcmVpADoYQGN1cnJlbnRfZXBpY19z
+Y29yZWkAOhlAY3VycmVudF9lcGljX2dyYWRlc3sAOhBAZXBpY19zY29yZWkA
+OhNAYXZlcmFnZV9ncmFkZTA6D0BhYmlsaXRpZXNbADoSQGxldmVsX251bWJl
+cmkGOhdAbGFzdF9sZXZlbF9udW1iZXIw
diff --git a/rubywarrior/ultimate-beginner/README b/rubywarrior/ultimate-beginner/README
new file mode 100644
index 0000000..9397ad5
--- /dev/null
+++ b/rubywarrior/ultimate-beginner/README
@@ -0,0 +1,21 @@
+Level 1
+
+You see before yourself a long hallway with stairs at the end. There is nothing in the way.
+
+Tip: Call warrior.walk! to walk forward in the Player 'play_turn' method.
+
+ --------
+|@ >|
+ --------
+
+ > = Stairs
+ @ = ultimate (20 HP)
+
+
+Warrior Abilities:
+
+ warrior.walk!
+ Move in the given direction (forward by default).
+
+
+When you're done editing player.rb, run the rubywarrior command again.
diff --git a/rubywarrior/ultimate-beginner/player.rb b/rubywarrior/ultimate-beginner/player.rb
new file mode 100644
index 0000000..f2b999d
--- /dev/null
+++ b/rubywarrior/ultimate-beginner/player.rb
@@ -0,0 +1,5 @@
+class Player
+ def play_turn(warrior)
+ warrior.walk!
+ end
+end
diff --git a/rubywarrior/ultimate-beginner/spec/player_spec.rb b/rubywarrior/ultimate-beginner/spec/player_spec.rb
new file mode 100644
index 0000000..b18d9d8
--- /dev/null
+++ b/rubywarrior/ultimate-beginner/spec/player_spec.rb
@@ -0,0 +1,19 @@
+require 'rspec'
+require 'rspec-fakes'
+require_relative '../player'
+
+describe Player do
+ let(:sut) { Player.new }
+
+ context "when resting" do
+ let(:warrior) { fake }
+
+ before :each do
+ sut.play_turn(warrior)
+ end
+
+ it "should walk forward" do
+ warrior.should have_received(:walk!)
+ end
+ end
+end