blam_and_woot 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) <2012> <Jeffrey Baird>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1 @@
1
+ Install this Gem and then use the command 'studio_gem' to run. Follow the prompts!
@@ -0,0 +1,12 @@
1
+ Knuckleheads High Scores:
2
+ Superman............465
3
+ Flash...............455
4
+ Hulk................440
5
+ Ironman.............430
6
+ Thor................230
7
+ Klutz...............210
8
+ Catwoman............180
9
+ Berserk.............180
10
+ Captain america.....115
11
+ Batman..............60
12
+ Spiderman...........15
data/bin/players.csv ADDED
@@ -0,0 +1,7 @@
1
+ Alvin
2
+ Simon
3
+ Theo
4
+ Prancer
5
+ Moe
6
+ Curly
7
+ Larry
data/bin/studio_game ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/studio_game/game'
4
+ require_relative '../lib/studio_game/player'
5
+ require_relative '../lib/studio_game/clumsy_player'
6
+ require_relative '../lib/studio_game/berserk_player'
7
+
8
+ knuckleheads = StudioGame::Game.new("Knuckleheads")
9
+ klutz = StudioGame::ClumsyPlayer.new("klutz",105,2)
10
+ berserk = StudioGame::BerserkPlayer.new("berserk", 50)
11
+
12
+ default_player_file = File.join(File.dirname(__FILE__), 'players.csv')
13
+ knuckleheads.load_players(ARGV.shift || default_player_file)
14
+ knuckleheads.add_player(klutz)
15
+ knuckleheads.add_player(berserk)
16
+
17
+ loop do
18
+ puts "\nHow many game rounds do you want to play?"
19
+ answer = gets.downcase.chomp
20
+ case answer
21
+ when /^\d+$/
22
+ knuckleheads.play(answer.to_i)
23
+ when 'quit','exit'
24
+ knuckleheads.print_stats
25
+ break
26
+ else
27
+ puts "Please enter a number or 'quit'"
28
+ end
29
+ end
30
+
31
+ knuckleheads.save_high_scores
@@ -0,0 +1,9 @@
1
+ Batman
2
+ Superman
3
+ Flash
4
+ Hulk
5
+ Catwoman
6
+ Spiderman
7
+ IronMan
8
+ Captain America
9
+ Thor
@@ -0,0 +1,9 @@
1
+ module StudioGame
2
+
3
+ module Auditable
4
+
5
+ def audit
6
+ puts "Rolled a #{self.number} (#{self.class})"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,34 @@
1
+ require_relative 'player'
2
+ require_relative 'game'
3
+
4
+ module StudioGame
5
+
6
+ class BerserkPlayer < Player
7
+
8
+ def initialize(name, health=100)
9
+ super(name, health)
10
+ @woot_count = 0
11
+ end
12
+
13
+ def berserk?
14
+ @woot_count > 5
15
+ end
16
+
17
+ def woot
18
+ super
19
+ @woot_count += 1
20
+ puts "#{@name} is berserk!" if berserk?
21
+ end
22
+
23
+ def blam
24
+ berserk? ? woot : super
25
+ end
26
+ end
27
+ end
28
+
29
+ if __FILE__ == $0
30
+ berserker = BerserkPlayer.new("berserker", 50)
31
+ 6.times { berserker.woot }
32
+ 6.times { berserker.blam }
33
+ puts berserker.health
34
+ end
@@ -0,0 +1,41 @@
1
+ require_relative 'player'
2
+
3
+ module StudioGame
4
+
5
+ class ClumsyPlayer < Player
6
+ attr_reader :boost_factor
7
+
8
+ def initialize(name, health=100, boost_factor=1)
9
+ super(name, health)
10
+ @boost_factor = boost_factor
11
+ end
12
+
13
+ def found_treasure treasure
14
+ damaged_treasure = Treasure.new(treasure.name, treasure.points / 2)
15
+ super damaged_treasure
16
+ end
17
+
18
+ def woot
19
+ @boost_factor.times { super }
20
+ end
21
+ end
22
+ end
23
+
24
+ if __FILE__ == $0
25
+ clumsy = ClumsyPlayer.new("klutz", 100, 10)
26
+
27
+ hammer = Treasure.new(:hammer, 50)
28
+ clumsy.found_treasure(hammer)
29
+ clumsy.found_treasure(hammer)
30
+ clumsy.found_treasure(hammer)
31
+ clumsy.woot
32
+ puts clumsy.health
33
+
34
+ crowbar = Treasure.new(:crowbar, 400)
35
+ clumsy.found_treasure(crowbar)
36
+
37
+ clumsy.each_found_treasure do |treasure|
38
+ puts "#{treasure.points} total #{treasure.name} points"
39
+ end
40
+ puts "#{clumsy.points} grand total points"
41
+ end
@@ -0,0 +1,23 @@
1
+ require_relative "auditable"
2
+
3
+ module StudioGame
4
+
5
+ class Die
6
+ include Auditable
7
+ attr_reader :number
8
+ # def initialize
9
+ # roll
10
+ # end
11
+ def roll
12
+ @number = rand(1..6)
13
+ audit
14
+ @number
15
+ end
16
+ end
17
+ end
18
+
19
+ if __FILE__ == $0
20
+
21
+ die = Die.new
22
+ die.roll
23
+ end
@@ -0,0 +1,102 @@
1
+ require_relative 'player'
2
+ require_relative 'game_turn'
3
+ require_relative 'treasure_trove'
4
+ require 'csv'
5
+ module StudioGame
6
+
7
+ class Game
8
+
9
+ attr_reader :title
10
+
11
+ def initialize title
12
+ @title = title
13
+ @players = []
14
+ end
15
+ #create a method that adds a player to the player array
16
+ def add_player a_player
17
+ @players.push (a_player)
18
+ end
19
+ #loop that prints the players and plays the game
20
+ def play rounds
21
+ puts "There are #{@players.size} players in #{@title}:"
22
+ #block that prints a player
23
+ @players.each do |player|
24
+ puts player
25
+ end
26
+
27
+ treasures = TreasureTrove::TREASURES
28
+ puts "\nThere are #{treasures.size} treasures to be found:"
29
+ treasures.each do |treasure|
30
+ puts "A #{treasure.name} is worth #{treasure.points} points"
31
+ end
32
+ #block that allows multiple games to be played
33
+ 1.upto(rounds) do |round|
34
+ puts "\nRound #{round}:"
35
+ @players.each do |player|
36
+ GameTurn.take_turn(player)
37
+ end
38
+ end
39
+ end
40
+
41
+ def total_points
42
+ @players.reduce(0) { |sum, player| sum + player.points }
43
+ end
44
+
45
+ def print_name_and_health(p)
46
+ puts "#{p.name} (#{p.health})"
47
+ end
48
+
49
+ def print_stats
50
+
51
+ puts "\n#{@title} Statistics:"
52
+
53
+ strong_players, wimpy_players = @players.partition { |player| player.strong? }
54
+
55
+ puts "#{strong_players.size} strong players:"
56
+ strong_players.each do |player|
57
+ print_name_and_health(player)
58
+ end
59
+
60
+ puts "#{wimpy_players.size} wimpy players:"
61
+ wimpy_players.each do |player|
62
+ print_name_and_health(player)
63
+ end
64
+
65
+ puts "\n#{@title} High Scores:"
66
+ @players.sort.each do |player|
67
+ puts "#{player.format_name} #{player.score}"
68
+ end
69
+
70
+ @players.sort.each do |player|
71
+ puts "\n#{player.name}'s point totals:"
72
+ player.each_found_treasure do |treasure|
73
+ puts "#{treasure.points} total #{treasure.name} points"
74
+ end
75
+
76
+ puts "#{player.points} grand total points"
77
+
78
+ end
79
+
80
+ puts "\n#{total_points} total points from treasures found"
81
+
82
+ end
83
+
84
+ def load_players (filename="players.csv")
85
+ CSV.foreach(filename) do |line|
86
+ player = Player.new(line[0], line[1].to_i)
87
+ add_player(player)
88
+ end
89
+ end
90
+
91
+ def save_high_scores (filename="high_scores.txt")
92
+ File.open(filename,"w") do |file|
93
+ file.puts "#{@title} High Scores:"
94
+ @players.sort.each do |player|
95
+ file.puts "#{player.format_name}#{player.score}"
96
+ end
97
+ end
98
+ end
99
+
100
+ end
101
+
102
+ end
@@ -0,0 +1,34 @@
1
+ require_relative 'die'
2
+ require_relative 'player'
3
+ require_relative 'treasure_trove'
4
+
5
+ module StudioGame
6
+
7
+ module GameTurn
8
+ def self.take_turn (player)
9
+ die = Die.new
10
+ number = die.roll
11
+ case number
12
+ when 1..2
13
+ player.blam
14
+ when 3..4
15
+ puts "#{player.name} was skipped"
16
+ else
17
+ player.woot
18
+ end
19
+ treasure = TreasureTrove.random
20
+ player.found_treasure(treasure)
21
+ end
22
+ end
23
+ end
24
+ if __FILE__ == $0
25
+ die = Die.new
26
+ player = Player.new("curly", 125)
27
+ GameTurn.take_turn(player)
28
+ GameTurn.take_turn(player)
29
+ GameTurn.take_turn(player)
30
+ GameTurn.take_turn(player)
31
+ GameTurn.take_turn(player)
32
+ GameTurn.take_turn(player)
33
+ GameTurn.take_turn(player)
34
+ end
@@ -0,0 +1,12 @@
1
+ require_relative 'auditable'
2
+ class LoadedDie
3
+ include Auditable
4
+ attr_reader :number
5
+
6
+ def roll
7
+ numbers = [1, 1, 2, 5, 6, 6]
8
+ @number = numbers.sample
9
+ audit
10
+ @number
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ module StudioGame
2
+
3
+ module Playable
4
+
5
+ def blam
6
+ self.health -= 10
7
+ puts "#{self.name} got blammed :("
8
+ end
9
+
10
+ def woot
11
+ @health += 15
12
+ puts "#{self.name} got w00ted!"
13
+ end
14
+
15
+ def strong?
16
+ self.health > 100
17
+ end
18
+
19
+ end
20
+
21
+ end
@@ -0,0 +1,74 @@
1
+ require_relative 'treasure_trove'
2
+ require_relative 'playable'
3
+
4
+ module StudioGame
5
+
6
+ class Player
7
+
8
+ include Playable
9
+ attr_accessor :name, :health
10
+
11
+ def initialize (name, health=100)
12
+ @name = name.capitalize
13
+ @health = health
14
+ @found_treasures = Hash.new(0)
15
+ end
16
+
17
+ def to_s
18
+ "I'm #{@name} with health = #{@health}, points = #{self.points}, and score = #{score}."
19
+ end
20
+
21
+ def format_name
22
+ name.ljust(20, '.')
23
+ end
24
+
25
+ def self.create_player_from_csv line
26
+ name, health = line.split(',')
27
+ if health == nil
28
+ health = 100
29
+ end
30
+ @player = Player.new(name.chomp, health.to_i)
31
+ end
32
+
33
+ def score
34
+ @health + self.points
35
+ end
36
+
37
+ def <=> (other)
38
+ other.score <=> score
39
+ end
40
+
41
+ def found_treasure treasure
42
+ @found_treasures[treasure.name] += treasure.points
43
+ puts "#{@name} found a #{treasure.name} worth #{treasure.points} points."
44
+ puts "#{@name}'s treasures: #{@found_treasures}"
45
+ end
46
+
47
+ def points
48
+ @found_treasures.values.reduce(0,:+)
49
+ end
50
+
51
+ def each_found_treasure
52
+ @found_treasures.each do |name, points|
53
+ yield Treasure.new(name, points)
54
+ end
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+
61
+ if __FILE__ == $0
62
+ player = Player.new("moe")
63
+ puts player.name
64
+ puts player.health
65
+ player.woot
66
+ puts player.health
67
+ player.blam
68
+ puts player.health
69
+ pie = Treasure.new(:pie,50)
70
+ shit = Treasure.new(:shit, 500)
71
+ player.found_treasure(shit)
72
+ player.found_treasure(pie)
73
+ player.each_found_treasure {|treasure| puts "#{treasure.name} is yummy" }
74
+ end
@@ -0,0 +1,20 @@
1
+ module StudioGame
2
+
3
+ Treasure = Struct.new(:name,:points)
4
+ module TreasureTrove
5
+ TREASURES = [
6
+ pie = Treasure.new(:pie,5),
7
+ bottle = Treasure.new(:bottle,25),
8
+ hammer = Treasure.new(:hammer,50),
9
+ skillet = Treasure.new(:skillet,100),
10
+ broomstick = Treasure.new(:broomstick,200),
11
+ crowbar = Treasure.new(:crowbar, 400)
12
+ ]
13
+
14
+ def self.random
15
+ TREASURES.sample
16
+ end
17
+ end
18
+ end
19
+
20
+
@@ -0,0 +1,32 @@
1
+ require 'studio_game/berserk_player'
2
+
3
+ module StudioGame
4
+
5
+ describe BerserkPlayer do
6
+
7
+ before do
8
+ @initial_health = 50
9
+ @player = BerserkPlayer.new("berserker", @initial_health)
10
+ end
11
+
12
+ it "does not go berserk when w00ted up to 5 times" do
13
+ 1.upto(5) { @player.woot }
14
+
15
+ @player.berserk?.should be_false
16
+ end
17
+
18
+ it "goes berserk when w00ted more than 5 times" do
19
+ 1.upto(6) { @player.woot }
20
+
21
+ @player.berserk?.should be_true
22
+ end
23
+
24
+ it "gets w00ted instead of blammed when it's gone berserk" do
25
+ 1.upto(6) { @player.woot }
26
+ 1.upto(2) { @player.blam }
27
+
28
+ @player.health.should == @initial_health + (8 * 15)
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,51 @@
1
+ require 'studio_game/clumsy_player'
2
+
3
+ module StudioGame
4
+
5
+ describe ClumsyPlayer do
6
+ before do
7
+ @player = ClumsyPlayer.new("klutz")
8
+ end
9
+
10
+ it "only gets half the point value for each treasure" do
11
+ @player.points.should == 0
12
+
13
+ hammer = Treasure.new(:hammer, 50)
14
+ @player.found_treasure(hammer)
15
+ @player.found_treasure(hammer)
16
+ @player.found_treasure(hammer)
17
+
18
+ @player.points.should == 75
19
+
20
+ crowbar = Treasure.new(:crowbar, 400)
21
+ @player.found_treasure(crowbar)
22
+
23
+ @player.points.should == 275
24
+
25
+ yielded = []
26
+ @player.each_found_treasure do |treasure|
27
+ yielded << treasure
28
+ end
29
+
30
+ yielded.should == [Treasure.new(:hammer, 75), Treasure.new(:crowbar, 200)]
31
+ end
32
+ context "with a boost factor" do
33
+ before do
34
+ @initial_health = 100
35
+ @boost_factor = 5
36
+ @player = ClumsyPlayer.new("klutz", @initial_health, @boost_factor)
37
+ end
38
+
39
+ it "has a boost factor" do
40
+ @player.boost_factor.should == 5
41
+ end
42
+
43
+ it "gets boost factor number of w00ts when w00ted" do
44
+ @player.woot
45
+
46
+ @player.health.should == @initial_health + (15 * @boost_factor)
47
+ end
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,84 @@
1
+ require 'studio_game/player'
2
+ require 'studio_game/game'
3
+
4
+ module StudioGame
5
+
6
+ describe Game do
7
+ context "player with a health of 150" do
8
+ before do
9
+ @health = 150
10
+ @player = Player.new("jeff", @health)
11
+ end
12
+ it "has a capitalized name" do
13
+ @player.name.should == "Jeff"
14
+ end
15
+ it "has an initial health" do
16
+ @health.should_not == nil
17
+ end
18
+ it "has a string representation" do
19
+ @player.should_not == ""
20
+ end
21
+ it "computes a score as the sum of its health and length of name" do
22
+ @player.score.should == (150)
23
+ end
24
+ it "increases health by 15 when w00ted" do
25
+ @player.woot
26
+ @player.health.should == (150 + 15)
27
+ end
28
+ it "decreases health by 10 when blammed" do
29
+ @player.blam
30
+ @player.health.should == (150 - 10)
31
+ end
32
+ it "assigns a treasure for points during a player's turn" do
33
+ game = Game.new("Knuckleheads")
34
+ player = Player.new("moe")
35
+
36
+ game.add_player(player)
37
+
38
+ game.play(1)
39
+
40
+ player.points.should_not be_zero
41
+ end
42
+ it "computes total points as the sum of all player points" do
43
+ game = Game.new("Knuckleheads")
44
+
45
+ player1 = Player.new("moe")
46
+ player2 = Player.new("larry")
47
+
48
+ game.add_player(player1)
49
+ game.add_player(player2)
50
+
51
+ player1.found_treasure(Treasure.new(:hammer, 50))
52
+ player1.found_treasure(Treasure.new(:hammer, 50))
53
+ player2.found_treasure(Treasure.new(:crowbar, 400))
54
+
55
+ game.total_points.should == 500
56
+ end
57
+ end
58
+ context "Testing for randomness" do
59
+ before do
60
+ @game = Game.new("Knuckleheads")
61
+
62
+ @initial_health = 100
63
+ @player = Player.new("moe", @initial_health)
64
+
65
+ @game.add_player(@player)
66
+ end
67
+ it "w00ts when there is a high roll" do
68
+ Die.any_instance.stub(:roll).and_return(5)
69
+ @game.play(2)
70
+ @player.health.should == @initial_health + (15 * 2)
71
+ end
72
+ it "blams when there is a low roll" do
73
+ Die.any_instance.stub(:roll).and_return(1)
74
+ @game.play(2)
75
+ @player.health.should == @initial_health - (10*2)
76
+ end
77
+ it "should skip when it is a medium roll" do
78
+ Die.any_instance.stub(:roll).and_return(3)
79
+ @game.play(2)
80
+ @player.health.should == @initial_health
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,94 @@
1
+ require 'studio_game/player'
2
+ require 'studio_game/treasure_trove.rb'
3
+
4
+ module StudioGame
5
+
6
+ describe Player do
7
+ context "player has health over 100" do
8
+ before do
9
+ @player = Player.new("jeff", 150)
10
+ end
11
+ it "is strong" do
12
+ @player.should be_strong
13
+ end
14
+ it "computes a score as the sum of its health and points" do
15
+ @player.found_treasure(Treasure.new(:hammer, 50))
16
+ @player.found_treasure(Treasure.new(:hammer, 50))
17
+
18
+ @player.score.should == 250
19
+ end
20
+ it "has a string representation" do
21
+ @player.found_treasure(Treasure.new(:hammer, 50))
22
+ @player.found_treasure(Treasure.new(:hammer, 50))
23
+
24
+ @player.to_s.should == "I'm Jeff with health = 150, points = 100, and score = 250."
25
+ end
26
+ end
27
+ context "player has a health of less than 100" do
28
+ before do
29
+ @player = Player.new("clare", 90)
30
+ end
31
+ it "is wimpy" do
32
+ @player.should_not be_strong
33
+ end
34
+ end
35
+ context "in a collection of players" do
36
+ before do
37
+ @player1 = Player.new("moe", 100)
38
+ @player2 = Player.new("larry", 200)
39
+ @player3 = Player.new("curly", 300)
40
+
41
+ @players = [@player3, @player2, @player1]
42
+ @players.sort
43
+ end
44
+
45
+ it "is sorted by decreasing score" do
46
+ @players.should == [@player1, @player2, @player3]
47
+ end
48
+ it "computes points as the sum of all treasure points" do
49
+ @player1.points.should == 0
50
+
51
+ @player1.found_treasure(Treasure.new(:hammer, 50))
52
+
53
+ @player1.points.should == 50
54
+
55
+ @player1.found_treasure(Treasure.new(:crowbar, 400))
56
+
57
+ @player1.points.should == 450
58
+
59
+ @player1.found_treasure(Treasure.new(:hammer, 50))
60
+
61
+ @player1.points.should == 500
62
+ end
63
+ it "yields each found treasure and its total points" do
64
+ @player1.found_treasure(Treasure.new(:skillet, 100))
65
+ @player1.found_treasure(Treasure.new(:skillet, 100))
66
+ @player1.found_treasure(Treasure.new(:hammer, 50))
67
+ @player1.found_treasure(Treasure.new(:bottle, 5))
68
+ @player1.found_treasure(Treasure.new(:bottle, 5))
69
+ @player1.found_treasure(Treasure.new(:bottle, 5))
70
+ @player1.found_treasure(Treasure.new(:bottle, 5))
71
+ @player1.found_treasure(Treasure.new(:bottle, 5))
72
+
73
+ yielded = []
74
+ @player1.each_found_treasure do |treasure|
75
+ yielded << treasure
76
+ end
77
+
78
+ yielded.should == [
79
+ Treasure.new(:skillet, 200),
80
+ Treasure.new(:hammer, 50),
81
+ Treasure.new(:bottle, 25)
82
+ ]
83
+ end
84
+ it "can be created from a CSV string" do
85
+ @player = Player.create_player_from_csv("larry,150")
86
+
87
+ @player.name.should == "Larry"
88
+ @player.health.should == 150
89
+ end
90
+ end
91
+
92
+ end
93
+
94
+ end
@@ -0,0 +1,57 @@
1
+ require 'studio_game/treasure_trove'
2
+
3
+ module StudioGame
4
+
5
+ describe Treasure do
6
+
7
+ before do
8
+ @treasure = Treasure.new(:hammer, 50)
9
+ end
10
+
11
+ it "has a name attribute" do
12
+ @treasure.name.should == :hammer
13
+ end
14
+
15
+ it "has a points attribute" do
16
+ @treasure.points.should == 50
17
+ end
18
+
19
+ end
20
+
21
+ describe TreasureTrove do
22
+
23
+ it "has six treasures" do
24
+ TreasureTrove::TREASURES.size.should == 6
25
+ end
26
+
27
+ it "has a pie worth 5 points" do
28
+ TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
29
+ end
30
+
31
+ it "has a bottle worth 25 points" do
32
+ TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
33
+ end
34
+
35
+ it "has a hammer worth 50 points" do
36
+ TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
37
+ end
38
+
39
+ it "has a skillet worth 100 points" do
40
+ TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
41
+ end
42
+
43
+ it "has a broomstick worth 200 points" do
44
+ TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
45
+ end
46
+
47
+ it "has a crowbar worth 400 points" do
48
+ TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
49
+ end
50
+
51
+ it "returns a random treasure" do
52
+ treasure = TreasureTrove.random
53
+
54
+ TreasureTrove::TREASURES.should include(treasure)
55
+ end
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blam_and_woot
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jeffrey Baird
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Install this Gem and then use the command 'studio_gem' to run. Follow
31
+ the prompts!
32
+ email: jeff@jeffreyleebaird.com
33
+ executables:
34
+ - studio_game
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - bin/high_scores.txt
39
+ - bin/players.csv
40
+ - bin/studio_game
41
+ - bin/super_hero.csv
42
+ - lib/studio_game/auditable.rb
43
+ - lib/studio_game/berserk_player.rb
44
+ - lib/studio_game/clumsy_player.rb
45
+ - lib/studio_game/die.rb
46
+ - lib/studio_game/game.rb
47
+ - lib/studio_game/game_turn.rb
48
+ - lib/studio_game/loaded_die.rb
49
+ - lib/studio_game/playable.rb
50
+ - lib/studio_game/player.rb
51
+ - lib/studio_game/treasure_trove.rb
52
+ - spec/studio_game/berserk_player_spec.rb
53
+ - spec/studio_game/clumsy_player_spec.rb
54
+ - spec/studio_game/game_spec.rb
55
+ - spec/studio_game/player_spec.rb
56
+ - spec/studio_game/treasure_trove_spec.rb
57
+ - LICENSE
58
+ - README
59
+ homepage: http://www.jeffreyleebaird.com
60
+ licenses: []
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '1.9'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 1.8.23
80
+ signing_key:
81
+ specification_version: 3
82
+ summary: My first game distributed as a public gem
83
+ test_files:
84
+ - spec/studio_game/berserk_player_spec.rb
85
+ - spec/studio_game/clumsy_player_spec.rb
86
+ - spec/studio_game/game_spec.rb
87
+ - spec/studio_game/player_spec.rb
88
+ - spec/studio_game/treasure_trove_spec.rb