studio_game_abr 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +7 -0
- data/README +3 -0
- data/bin/high_scores.txt +6 -0
- data/bin/player.csv +3 -0
- data/bin/player.csv~ +3 -0
- data/bin/studio_game +34 -0
- data/bin/studio_game.rb~ +32 -0
- data/bin/studio_game~ +32 -0
- data/lib/studio_game/auditable.rb +7 -0
- data/lib/studio_game/berserk_player.rb +37 -0
- data/lib/studio_game/clumsy_player.rb +28 -0
- data/lib/studio_game/die.rb +18 -0
- data/lib/studio_game/files.rb +9 -0
- data/lib/studio_game/game.rb +105 -0
- data/lib/studio_game/game_turn.rb +24 -0
- data/lib/studio_game/items.rb +24 -0
- data/lib/studio_game/iterators.rb +14 -0
- data/lib/studio_game/loaded_die.rb +13 -0
- data/lib/studio_game/playable.rb +17 -0
- data/lib/studio_game/player.rb +78 -0
- data/lib/studio_game/treasure_trove.rb +22 -0
- data/spec/studio_game/berserk_player_spec.rb +36 -0
- data/spec/studio_game/berserk_player_spec.rb~ +36 -0
- data/spec/studio_game/clumsy_player_spec.rb +33 -0
- data/spec/studio_game/clumsy_player_spec.rb~ +33 -0
- data/spec/studio_game/game_spec.rb +52 -0
- data/spec/studio_game/game_spec.rb~ +52 -0
- data/spec/studio_game/player_spec.rb +135 -0
- data/spec/studio_game/player_spec.rb~ +135 -0
- data/spec/studio_game/treasure_trove_spec.rb +51 -0
- data/spec/studio_game/treasure_trove_spec.rb~ +51 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 17513abc07d0f202809899c1ad1d756773fd3455
|
4
|
+
data.tar.gz: 4ce4842f216444813fc212a72ff4beb9aba31c6f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8bc19e87798086f163d894cfff8ed2cc4bf44e463664eedc3ad07c82fc2a3f4b71e4e6f80fa85c6585115e44ee14717bda114c3100d7fafd90f8596f0616247c
|
7
|
+
data.tar.gz: bc256e361aaa725c6d2e83bcb0b97fdf8394d781fd9da188cff0d14d5a167aa5e96df71fcd26c0bf8b3dc697ed66f41d4651e81cb723e71db4a507452501344d
|
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2016 [ABR Co.]
|
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
data/bin/high_scores.txt
ADDED
data/bin/player.csv
ADDED
data/bin/player.csv~
ADDED
data/bin/studio_game
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative '../lib/studio_game/player'
|
4
|
+
require_relative '../lib/studio_game/clumsy_player'
|
5
|
+
require_relative '../lib/studio_game/berserk_player'
|
6
|
+
require_relative '../lib/studio_game/game'
|
7
|
+
|
8
|
+
my_list = StudioGame::Game.new("Knuckleheads")
|
9
|
+
|
10
|
+
default_player_file = File.join(File.dirname(__FILE__), 'player.csv')
|
11
|
+
my_list.load_players(ARGV.shift || default_player_file)
|
12
|
+
|
13
|
+
k = StudioGame::ClumsyPlayer.new("klutz", 105)
|
14
|
+
b = StudioGame::BerserkPlayer.new("berserk", 5)
|
15
|
+
my_list.add_player(k)
|
16
|
+
my_list.add_player(b)
|
17
|
+
|
18
|
+
loop do
|
19
|
+
puts "How many games? ('quit' to exit)"
|
20
|
+
num_games = gets.chomp.downcase
|
21
|
+
case num_games
|
22
|
+
when /^\d+$/
|
23
|
+
puts"\nEnjoy your #{num_games} games.\n"
|
24
|
+
my_list.play(num_games.to_i)
|
25
|
+
when 'quit', 'exit'
|
26
|
+
my_list.print_stats
|
27
|
+
break
|
28
|
+
else
|
29
|
+
puts "Please enter a number or 'quit'"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
my_list.save_high_scores
|
34
|
+
|
data/bin/studio_game.rb~
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative '../lib/studio_game/player'
|
2
|
+
require_relative '../lib/studio_game/clumsy_player'
|
3
|
+
require_relative '../lib/studio_game/berserk_player'
|
4
|
+
require_relative '../lib/studio_game/game'
|
5
|
+
|
6
|
+
my_list = StudioGame::Game.new("Knuckleheads")
|
7
|
+
|
8
|
+
default_player_file = File.join(File.dirname(__FILE__), 'player.csv')
|
9
|
+
my_list.load_players(ARGV.shift || "default_player_file")
|
10
|
+
|
11
|
+
k = StudioGame::ClumsyPlayer.new("klutz", 105)
|
12
|
+
b = StudioGame::BerserkPlayer.new("berserk", 5)
|
13
|
+
my_list.add_player(k)
|
14
|
+
my_list.add_player(b)
|
15
|
+
|
16
|
+
loop do
|
17
|
+
puts "How many games? ('quit' to exit)"
|
18
|
+
num_games = gets.chomp.downcase
|
19
|
+
case num_games
|
20
|
+
when /^\d+$/
|
21
|
+
puts"\nEnjoy your #{num_games} games.\n"
|
22
|
+
my_list.play(num_games.to_i)
|
23
|
+
when 'quit', 'exit'
|
24
|
+
my_list.print_stats
|
25
|
+
break
|
26
|
+
else
|
27
|
+
puts "Please enter a number or 'quit'"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
my_list.save_high_scores
|
32
|
+
|
data/bin/studio_game~
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative '../lib/studio_game/player'
|
2
|
+
require_relative '../lib/studio_game/clumsy_player'
|
3
|
+
require_relative '../lib/studio_game/berserk_player'
|
4
|
+
require_relative '../lib/studio_game/game'
|
5
|
+
|
6
|
+
my_list = StudioGame::Game.new("Knuckleheads")
|
7
|
+
|
8
|
+
default_player_file = File.join(File.dirname(__FILE__), 'player.csv')
|
9
|
+
my_list.load_players(ARGV.shift || default_player_file)
|
10
|
+
|
11
|
+
k = StudioGame::ClumsyPlayer.new("klutz", 105)
|
12
|
+
b = StudioGame::BerserkPlayer.new("berserk", 5)
|
13
|
+
my_list.add_player(k)
|
14
|
+
my_list.add_player(b)
|
15
|
+
|
16
|
+
loop do
|
17
|
+
puts "How many games? ('quit' to exit)"
|
18
|
+
num_games = gets.chomp.downcase
|
19
|
+
case num_games
|
20
|
+
when /^\d+$/
|
21
|
+
puts"\nEnjoy your #{num_games} games.\n"
|
22
|
+
my_list.play(num_games.to_i)
|
23
|
+
when 'quit', 'exit'
|
24
|
+
my_list.print_stats
|
25
|
+
break
|
26
|
+
else
|
27
|
+
puts "Please enter a number or 'quit'"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
my_list.save_high_scores
|
32
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'player'
|
2
|
+
|
3
|
+
|
4
|
+
module StudioGame
|
5
|
+
class BerserkPlayer < Player
|
6
|
+
def initialize(player, health = 100)
|
7
|
+
super(player, health)
|
8
|
+
@w00t_count = 0
|
9
|
+
end
|
10
|
+
|
11
|
+
def berserk?
|
12
|
+
@w00t_count > 5
|
13
|
+
end
|
14
|
+
|
15
|
+
def w00t
|
16
|
+
super
|
17
|
+
@w00t_count += 1
|
18
|
+
puts "#{@name} is berserk!" if berserk?
|
19
|
+
end
|
20
|
+
|
21
|
+
def blam
|
22
|
+
if berserk?
|
23
|
+
w00t
|
24
|
+
else
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if __FILE__ == $0
|
32
|
+
berserker = BerserkPlayer.new("berserker", 50)
|
33
|
+
|
34
|
+
1.upto(6) {berserker.w00t}
|
35
|
+
1.upto(2) {berserker.blam}
|
36
|
+
puts berserker.health
|
37
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'player'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
class ClumsyPlayer < Player
|
5
|
+
|
6
|
+
def found_treasure(treasure)
|
7
|
+
damaged_treasure = Treasure.new(treasure.name, treasure.value / 2)
|
8
|
+
super(damaged_treasure)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
if __FILE__ == $0
|
14
|
+
clumsy = ClumsyPlayer.new("klutz")
|
15
|
+
|
16
|
+
hammer = Treasure.new(:hammer, 50)
|
17
|
+
clumsy.found_treasure(hammer)
|
18
|
+
clumsy.found_treasure(hammer)
|
19
|
+
clumsy.found_treasure(hammer)
|
20
|
+
|
21
|
+
crowbar = Treasure.new(:crowbar, 400)
|
22
|
+
clumsy.found_treasure(crowbar)
|
23
|
+
|
24
|
+
clumsy.each_found_treasure do |treasure|
|
25
|
+
puts "#{treasure.value} total #{treasure.name} points"
|
26
|
+
end
|
27
|
+
puts "#{clumsy.points} grand total points"
|
28
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require_relative 'player'
|
2
|
+
require_relative 'die'
|
3
|
+
require_relative 'game_turn'
|
4
|
+
require_relative 'treasure_trove'
|
5
|
+
|
6
|
+
module StudioGame
|
7
|
+
class Game
|
8
|
+
attr_accessor :name
|
9
|
+
attr_reader :players
|
10
|
+
|
11
|
+
def initialize(mylist)
|
12
|
+
@name = mylist.capitalize
|
13
|
+
@players = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def load_players(from_file)
|
17
|
+
File.readlines(from_file).each do |line|
|
18
|
+
add_player(Player.from_csv(line))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def save_high_scores(to_file="high_scores.txt")
|
23
|
+
File.open(to_file, "w") do |file|
|
24
|
+
file.puts "#{@name} High Scores:"
|
25
|
+
|
26
|
+
@players.sort.each do |p|
|
27
|
+
file.puts high_score_entry(p)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def add_player(player)
|
33
|
+
@players << player
|
34
|
+
end
|
35
|
+
|
36
|
+
def play(rounds)
|
37
|
+
puts "#{@name}'s game:"
|
38
|
+
puts @players.sort
|
39
|
+
|
40
|
+
treasures = TreasureTrove::TREASURES
|
41
|
+
puts "\nThere are #{treasures.size} treasures to be found:"
|
42
|
+
|
43
|
+
|
44
|
+
treasures.each do |t|
|
45
|
+
puts "A #{t.name} has a value of #{t.value}. "
|
46
|
+
end
|
47
|
+
|
48
|
+
1.upto(rounds) do |round|
|
49
|
+
puts "\nRound #{round}:"
|
50
|
+
@players.each do |player|
|
51
|
+
GameTurn.take_turn(player)
|
52
|
+
player.found_treasure(TreasureTrove.random)
|
53
|
+
puts player
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
def print_name_and_health(p)
|
60
|
+
puts "#{p.name} has a health of #{p.health}"
|
61
|
+
end
|
62
|
+
|
63
|
+
def total_points
|
64
|
+
@players.reduce(0) do |sum, player|
|
65
|
+
sum + player.points
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def high_score_entry(player)
|
70
|
+
formatted_name = player.name.ljust(20, '.')
|
71
|
+
"#{formatted_name} #{player.score}"
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
def print_stats
|
76
|
+
puts "\n#{@name}'s Stats:"
|
77
|
+
|
78
|
+
puts "#{total_points} total points earned"
|
79
|
+
@players.sort.each do |player|
|
80
|
+
puts "\n#{player.name}'s treasure totals:"
|
81
|
+
player.each_found_treasure do |treasure|
|
82
|
+
puts "#{treasure.value} total #{treasure.name} points"
|
83
|
+
end
|
84
|
+
puts "#{player.points} grand total points."
|
85
|
+
end
|
86
|
+
strong, weak = @players.partition { |p| p.strong? }
|
87
|
+
|
88
|
+
|
89
|
+
puts "\nStrong:"
|
90
|
+
strong.each {|p| self.print_name_and_health(p)}
|
91
|
+
|
92
|
+
puts "\nWeak:"
|
93
|
+
weak.each {|p| self.print_name_and_health(p)}
|
94
|
+
|
95
|
+
puts "\n High Scores:"
|
96
|
+
@players.sort.each do |p|
|
97
|
+
puts high_score_entry(p)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def to_s
|
102
|
+
"There are #{@players.size} players in #{name}"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'treasure_trove'
|
2
|
+
require_relative 'die'
|
3
|
+
|
4
|
+
module StudioGame
|
5
|
+
module GameTurn
|
6
|
+
|
7
|
+
def self.take_turn(player)
|
8
|
+
|
9
|
+
treasure = TreasureTrove.random
|
10
|
+
player.found_treasure(treasure)
|
11
|
+
die = Die.new
|
12
|
+
number_rolled = die.roll
|
13
|
+
case number_rolled
|
14
|
+
when 1..2
|
15
|
+
player.blam
|
16
|
+
when 3..4
|
17
|
+
puts "#{player.name} was skipped."
|
18
|
+
else
|
19
|
+
player.w00t
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Treasure = Struct.new(:name, :value)
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
module TreasureTrove
|
5
|
+
|
6
|
+
Treasure = [
|
7
|
+
Treasure.new('', )
|
8
|
+
Treasure.new('', )
|
9
|
+
Treasure.new('', )
|
10
|
+
Treasure.new('', )
|
11
|
+
Treasure.new('', )
|
12
|
+
]
|
13
|
+
|
14
|
+
def self.random
|
15
|
+
SNACKS.sample
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if __FILE__ == $0
|
21
|
+
puts TreasureTrove::TREASURE
|
22
|
+
snack = TreasureTrove.random
|
23
|
+
puts "Enjoy your #{item.name} (#{item.value})"
|
24
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require_relative 'treasure_trove'
|
2
|
+
require_relative 'playable'
|
3
|
+
|
4
|
+
module StudioGame
|
5
|
+
class Player
|
6
|
+
include Playable
|
7
|
+
attr_accessor :name
|
8
|
+
attr_reader :health
|
9
|
+
|
10
|
+
def initialize(player, health = 100)
|
11
|
+
@name = player.capitalize
|
12
|
+
@health = health
|
13
|
+
@found_treasures = Hash.new(0)
|
14
|
+
end
|
15
|
+
|
16
|
+
def each_found_treasure
|
17
|
+
@found_treasures.each do |name, points|
|
18
|
+
treasure = Treasure.new(name, points)
|
19
|
+
yield treasure
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def points
|
24
|
+
@found_treasures.values.reduce(0, :+)
|
25
|
+
end
|
26
|
+
|
27
|
+
def found_treasure(treasure)
|
28
|
+
@found_treasures[treasure.name] += treasure.value
|
29
|
+
puts "#{@name} found a #{treasure.name} worth #{treasure.value} points."
|
30
|
+
puts "#{@name}'s treasures: #{@found_treasures}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def w00t
|
34
|
+
@health = @health + 15
|
35
|
+
puts "#{@name} got w00ted!"
|
36
|
+
end
|
37
|
+
|
38
|
+
def blam
|
39
|
+
@health = @health - 10
|
40
|
+
puts "#{@name} got blammed!"
|
41
|
+
end
|
42
|
+
|
43
|
+
def score
|
44
|
+
@health + points
|
45
|
+
end
|
46
|
+
|
47
|
+
def <=>(other_player)
|
48
|
+
other_player.score <=> score
|
49
|
+
end
|
50
|
+
|
51
|
+
def strong?
|
52
|
+
@health > 100
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.from_csv(string)
|
56
|
+
name, health = string.split(',')
|
57
|
+
player = Player.new(name, Integer(health))
|
58
|
+
end
|
59
|
+
|
60
|
+
def to_csv
|
61
|
+
"#{@name}, #{points}"
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_s
|
65
|
+
"#{@name} currently has a health of #{@health}, #{points} points, and a score of #{score}\n "
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
if __FILE__ == $0
|
71
|
+
player = Player.new("moe")
|
72
|
+
puts player.name
|
73
|
+
puts player.health
|
74
|
+
player.w00t
|
75
|
+
puts player.health
|
76
|
+
player.blam
|
77
|
+
puts player.health
|
78
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module StudioGame
|
2
|
+
Treasure = Struct.new(:name, :value)
|
3
|
+
|
4
|
+
module TreasureTrove
|
5
|
+
TREASURES = [
|
6
|
+
Treasure.new(:pie,5 ),
|
7
|
+
Treasure.new(:bottle,25 ),
|
8
|
+
Treasure.new(:hammer,50 ),
|
9
|
+
Treasure.new(:skillet,100 ),
|
10
|
+
Treasure.new(:broomstick,200 ),
|
11
|
+
Treasure.new(:crowbar,400 )
|
12
|
+
]
|
13
|
+
|
14
|
+
def self.random
|
15
|
+
TREASURES.sample
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if __FILE__ == $0
|
21
|
+
puts TreasureTrove::TREASURES
|
22
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'studio_game/berserk_player'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe BerserkPlayer do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@initial_health = 50
|
8
|
+
@player = BerserkPlayer.new("berserker", @initial_health)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "does not go berserk when w00ted up to 5 times" do
|
12
|
+
1.upto(5) { @player.w00t }
|
13
|
+
|
14
|
+
@player.berserk?.should be_falsey
|
15
|
+
# or if using Rspec 3.0:
|
16
|
+
# @player.berserk?.should be_falsey
|
17
|
+
end
|
18
|
+
|
19
|
+
it "goes berserk when w00ted more than 5 times" do
|
20
|
+
1.upto(6) { @player.w00t }
|
21
|
+
|
22
|
+
@player.berserk?.should be_truthy
|
23
|
+
|
24
|
+
# or if using Rspec 3.0:
|
25
|
+
# @player.berserk?.should be_truthy
|
26
|
+
end
|
27
|
+
|
28
|
+
it "gets w00ted instead of blammed when it's gone berserk" do
|
29
|
+
1.upto(6) { @player.w00t }
|
30
|
+
1.upto(2) { @player.blam }
|
31
|
+
|
32
|
+
@player.health.should == @initial_health + (8 * 15)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative 'berserk_player'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe BerserkPlayer do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@initial_health = 50
|
8
|
+
@player = BerserkPlayer.new("berserker", @initial_health)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "does not go berserk when w00ted up to 5 times" do
|
12
|
+
1.upto(5) { @player.w00t }
|
13
|
+
|
14
|
+
@player.berserk?.should be_falsey
|
15
|
+
# or if using Rspec 3.0:
|
16
|
+
# @player.berserk?.should be_falsey
|
17
|
+
end
|
18
|
+
|
19
|
+
it "goes berserk when w00ted more than 5 times" do
|
20
|
+
1.upto(6) { @player.w00t }
|
21
|
+
|
22
|
+
@player.berserk?.should be_truthy
|
23
|
+
|
24
|
+
# or if using Rspec 3.0:
|
25
|
+
# @player.berserk?.should be_truthy
|
26
|
+
end
|
27
|
+
|
28
|
+
it "gets w00ted instead of blammed when it's gone berserk" do
|
29
|
+
1.upto(6) { @player.w00t }
|
30
|
+
1.upto(2) { @player.blam }
|
31
|
+
|
32
|
+
@player.health.should == @initial_health + (8 * 15)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'studio_game/clumsy_player'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe ClumsyPlayer do
|
5
|
+
before do
|
6
|
+
@player = ClumsyPlayer.new("klutz")
|
7
|
+
end
|
8
|
+
|
9
|
+
it "only gets half the point value for each treasure" do
|
10
|
+
@player.points.should == 0
|
11
|
+
|
12
|
+
hammer = Treasure.new(:hammer, 50)
|
13
|
+
@player.found_treasure(hammer)
|
14
|
+
@player.found_treasure(hammer)
|
15
|
+
@player.found_treasure(hammer)
|
16
|
+
|
17
|
+
@player.points.should == 75
|
18
|
+
|
19
|
+
crowbar = Treasure.new(:crowbar, 400)
|
20
|
+
@player.found_treasure(crowbar)
|
21
|
+
|
22
|
+
@player.points.should == 275
|
23
|
+
|
24
|
+
yielded = []
|
25
|
+
@player.each_found_treasure do |treasure|
|
26
|
+
yielded << treasure
|
27
|
+
end
|
28
|
+
|
29
|
+
yielded.should == [Treasure.new(:hammer, 75), Treasure.new(:crowbar, 200)]
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'clumsy_player'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe ClumsyPlayer do
|
5
|
+
before do
|
6
|
+
@player = ClumsyPlayer.new("klutz")
|
7
|
+
end
|
8
|
+
|
9
|
+
it "only gets half the point value for each treasure" do
|
10
|
+
@player.points.should == 0
|
11
|
+
|
12
|
+
hammer = Treasure.new(:hammer, 50)
|
13
|
+
@player.found_treasure(hammer)
|
14
|
+
@player.found_treasure(hammer)
|
15
|
+
@player.found_treasure(hammer)
|
16
|
+
|
17
|
+
@player.points.should == 75
|
18
|
+
|
19
|
+
crowbar = Treasure.new(:crowbar, 400)
|
20
|
+
@player.found_treasure(crowbar)
|
21
|
+
|
22
|
+
@player.points.should == 275
|
23
|
+
|
24
|
+
yielded = []
|
25
|
+
@player.each_found_treasure do |treasure|
|
26
|
+
yielded << treasure
|
27
|
+
end
|
28
|
+
|
29
|
+
yielded.should == [Treasure.new(:hammer, 75), Treasure.new(:crowbar, 200)]
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'studio_game/game'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe Game do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@game = Game.new("Knuckleheads")
|
8
|
+
end
|
9
|
+
|
10
|
+
context "game rules" do
|
11
|
+
before do
|
12
|
+
@initial_health = 100
|
13
|
+
@player = Player.new("moe", @initial_health)
|
14
|
+
@game.add_player(@player)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "heals the player if a high number is rolled" do
|
18
|
+
Die.any_instance.stub(:roll).and_return(5)
|
19
|
+
@game.play(2)
|
20
|
+
|
21
|
+
|
22
|
+
@player.health.should == @initial_health + (15*2)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "keeps the health the same if a 3 or 4 is rolled" do
|
26
|
+
Die.any_instance.stub(:roll).and_return(4)
|
27
|
+
@game.play(2)
|
28
|
+
|
29
|
+
|
30
|
+
@player.health.should == @initial_health
|
31
|
+
end
|
32
|
+
|
33
|
+
it "hits the player if a low number is rolled" do
|
34
|
+
Die.any_instance.stub(:roll).and_return(2)
|
35
|
+
@game.play(2)
|
36
|
+
|
37
|
+
|
38
|
+
@player.health.should == @initial_health - (10*2)
|
39
|
+
end
|
40
|
+
it "assigns a treasure for points during a player's turn" do
|
41
|
+
game = Game.new("Knuckleheads")
|
42
|
+
player = Player.new("moe")
|
43
|
+
|
44
|
+
game.add_player(player)
|
45
|
+
|
46
|
+
game.play(1)
|
47
|
+
|
48
|
+
player.points.should_not be_zero
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require_relative 'game'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe Game do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@game = Game.new("Knuckleheads")
|
8
|
+
end
|
9
|
+
|
10
|
+
context "game rules" do
|
11
|
+
before do
|
12
|
+
@initial_health = 100
|
13
|
+
@player = Player.new("moe", @initial_health)
|
14
|
+
@game.add_player(@player)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "heals the player if a high number is rolled" do
|
18
|
+
Die.any_instance.stub(:roll).and_return(5)
|
19
|
+
@game.play(2)
|
20
|
+
|
21
|
+
|
22
|
+
@player.health.should == @initial_health + (15*2)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "keeps the health the same if a 3 or 4 is rolled" do
|
26
|
+
Die.any_instance.stub(:roll).and_return(4)
|
27
|
+
@game.play(2)
|
28
|
+
|
29
|
+
|
30
|
+
@player.health.should == @initial_health
|
31
|
+
end
|
32
|
+
|
33
|
+
it "hits the player if a low number is rolled" do
|
34
|
+
Die.any_instance.stub(:roll).and_return(2)
|
35
|
+
@game.play(2)
|
36
|
+
|
37
|
+
|
38
|
+
@player.health.should == @initial_health - (10*2)
|
39
|
+
end
|
40
|
+
it "assigns a treasure for points during a player's turn" do
|
41
|
+
game = Game.new("Knuckleheads")
|
42
|
+
player = Player.new("moe")
|
43
|
+
|
44
|
+
game.add_player(player)
|
45
|
+
|
46
|
+
game.play(1)
|
47
|
+
|
48
|
+
player.points.should_not be_zero
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'studio_game/player'
|
2
|
+
require 'studio_game/treasure_trove'
|
3
|
+
|
4
|
+
module StudioGame
|
5
|
+
describe Player do
|
6
|
+
|
7
|
+
before do
|
8
|
+
$stdout = StringIO.new
|
9
|
+
@initial_health = 150
|
10
|
+
@player = Player.new("larry", @initial_health)
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
it "has a capitalized name" do
|
15
|
+
#@player.name.should == "Larry"
|
16
|
+
expect(@player.name).to eq("Larry")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "has an initial health of 100" do
|
20
|
+
@player = Player.new("larry")
|
21
|
+
|
22
|
+
#@player.health.should == 100
|
23
|
+
expect(@player.health).to eq(100)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "has a string representation" do
|
27
|
+
|
28
|
+
#@player.to_s.should == "Larry has a health of 100 and a score of 105\n "
|
29
|
+
expect(@player.to_s).to eq("Larry currently has a health of 150, 0 points, and a score of 150\n ")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "increased health by 15 when w00ted" do
|
33
|
+
|
34
|
+
@player.w00t
|
35
|
+
#@player.health.should == @initial_health + 15
|
36
|
+
expect(@player.health).to eq(@initial_health + 15)
|
37
|
+
end
|
38
|
+
context "with a health of less than 100" do
|
39
|
+
before do
|
40
|
+
@player = Player.new("Larry", 99)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
it "decreased health by 10 when blammed" do
|
44
|
+
@player.blam
|
45
|
+
#@player.health.should == @initial_health - 10
|
46
|
+
expect(@player.health).to eq(@initial_health - 10)
|
47
|
+
end
|
48
|
+
|
49
|
+
context "with a health of at least 100" do
|
50
|
+
before do
|
51
|
+
@player = Player.new("Larry", 150)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "is a player strong" do
|
55
|
+
expect(@player).to be_strong
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "with a health of less than 100" do
|
60
|
+
before do
|
61
|
+
@player = Player.new("Larry", 99)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "is a player injured" do
|
65
|
+
expect(@player).not_to be_strong
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "in a collection of players" do
|
70
|
+
before do
|
71
|
+
@player1 = Player.new("moe", 100)
|
72
|
+
@player2 = Player.new("larry", 200)
|
73
|
+
@player3 = Player.new("curly", 300)
|
74
|
+
|
75
|
+
@players = [@player1, @player2, @player3]
|
76
|
+
end
|
77
|
+
|
78
|
+
it "is sorted by decreasing score" do
|
79
|
+
@players.sort.should == [@player3, @player2, @player1]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
it "computes points as the sum of all treasure points" do
|
84
|
+
@player.points.should == 0
|
85
|
+
|
86
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
87
|
+
|
88
|
+
@player.points.should == 50
|
89
|
+
|
90
|
+
@player.found_treasure(Treasure.new(:crowbar, 400))
|
91
|
+
|
92
|
+
@player.points.should == 450
|
93
|
+
|
94
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
95
|
+
|
96
|
+
@player.points.should == 500
|
97
|
+
end
|
98
|
+
|
99
|
+
it "computes a score as the sum of its health and points" do
|
100
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
101
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
102
|
+
|
103
|
+
@player.score.should == 250
|
104
|
+
end
|
105
|
+
it "yields each found treasure and its total points" do
|
106
|
+
@player.found_treasure(Treasure.new(:skillet, 100))
|
107
|
+
@player.found_treasure(Treasure.new(:skillet, 100))
|
108
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
109
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
110
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
111
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
112
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
113
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
114
|
+
|
115
|
+
yielded = []
|
116
|
+
@player.each_found_treasure do |treasure|
|
117
|
+
yielded << treasure
|
118
|
+
end
|
119
|
+
|
120
|
+
yielded.should == [
|
121
|
+
Treasure.new(:skillet, 200),
|
122
|
+
Treasure.new(:hammer, 50),
|
123
|
+
Treasure.new(:bottle, 25)
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
it "can be created from a CSV string" do
|
128
|
+
player = Player.from_csv("larry,150")
|
129
|
+
|
130
|
+
player.name.should == "Larry"
|
131
|
+
player.health.should == 150
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'studio_game/player'
|
2
|
+
require_relative 'treasure_trove'
|
3
|
+
|
4
|
+
module StudioGame
|
5
|
+
describe Player do
|
6
|
+
|
7
|
+
before do
|
8
|
+
$stdout = StringIO.new
|
9
|
+
@initial_health = 150
|
10
|
+
@player = Player.new("larry", @initial_health)
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
it "has a capitalized name" do
|
15
|
+
#@player.name.should == "Larry"
|
16
|
+
expect(@player.name).to eq("Larry")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "has an initial health of 100" do
|
20
|
+
@player = Player.new("larry")
|
21
|
+
|
22
|
+
#@player.health.should == 100
|
23
|
+
expect(@player.health).to eq(100)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "has a string representation" do
|
27
|
+
|
28
|
+
#@player.to_s.should == "Larry has a health of 100 and a score of 105\n "
|
29
|
+
expect(@player.to_s).to eq("Larry currently has a health of 150, 0 points, and a score of 150\n ")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "increased health by 15 when w00ted" do
|
33
|
+
|
34
|
+
@player.w00t
|
35
|
+
#@player.health.should == @initial_health + 15
|
36
|
+
expect(@player.health).to eq(@initial_health + 15)
|
37
|
+
end
|
38
|
+
context "with a health of less than 100" do
|
39
|
+
before do
|
40
|
+
@player = Player.new("Larry", 99)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
it "decreased health by 10 when blammed" do
|
44
|
+
@player.blam
|
45
|
+
#@player.health.should == @initial_health - 10
|
46
|
+
expect(@player.health).to eq(@initial_health - 10)
|
47
|
+
end
|
48
|
+
|
49
|
+
context "with a health of at least 100" do
|
50
|
+
before do
|
51
|
+
@player = Player.new("Larry", 150)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "is a player strong" do
|
55
|
+
expect(@player).to be_strong
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "with a health of less than 100" do
|
60
|
+
before do
|
61
|
+
@player = Player.new("Larry", 99)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "is a player injured" do
|
65
|
+
expect(@player).not_to be_strong
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "in a collection of players" do
|
70
|
+
before do
|
71
|
+
@player1 = Player.new("moe", 100)
|
72
|
+
@player2 = Player.new("larry", 200)
|
73
|
+
@player3 = Player.new("curly", 300)
|
74
|
+
|
75
|
+
@players = [@player1, @player2, @player3]
|
76
|
+
end
|
77
|
+
|
78
|
+
it "is sorted by decreasing score" do
|
79
|
+
@players.sort.should == [@player3, @player2, @player1]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
it "computes points as the sum of all treasure points" do
|
84
|
+
@player.points.should == 0
|
85
|
+
|
86
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
87
|
+
|
88
|
+
@player.points.should == 50
|
89
|
+
|
90
|
+
@player.found_treasure(Treasure.new(:crowbar, 400))
|
91
|
+
|
92
|
+
@player.points.should == 450
|
93
|
+
|
94
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
95
|
+
|
96
|
+
@player.points.should == 500
|
97
|
+
end
|
98
|
+
|
99
|
+
it "computes a score as the sum of its health and points" do
|
100
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
101
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
102
|
+
|
103
|
+
@player.score.should == 250
|
104
|
+
end
|
105
|
+
it "yields each found treasure and its total points" do
|
106
|
+
@player.found_treasure(Treasure.new(:skillet, 100))
|
107
|
+
@player.found_treasure(Treasure.new(:skillet, 100))
|
108
|
+
@player.found_treasure(Treasure.new(:hammer, 50))
|
109
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
110
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
111
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
112
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
113
|
+
@player.found_treasure(Treasure.new(:bottle, 5))
|
114
|
+
|
115
|
+
yielded = []
|
116
|
+
@player.each_found_treasure do |treasure|
|
117
|
+
yielded << treasure
|
118
|
+
end
|
119
|
+
|
120
|
+
yielded.should == [
|
121
|
+
Treasure.new(:skillet, 200),
|
122
|
+
Treasure.new(:hammer, 50),
|
123
|
+
Treasure.new(:bottle, 25)
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
it "can be created from a CSV string" do
|
128
|
+
player = Player.from_csv("larry,150")
|
129
|
+
|
130
|
+
player.name.should == "Larry"
|
131
|
+
player.health.should == 150
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'studio_game/treasure_trove'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe Treasure do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@treasure = Treasure.new(:hammer, 50)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "has a name attribute" do
|
11
|
+
@treasure.name.should == :hammer
|
12
|
+
end
|
13
|
+
|
14
|
+
it "has a points attribute" do
|
15
|
+
@treasure.value.should == 50
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
describe TreasureTrove do
|
21
|
+
|
22
|
+
it "has six treasures" do
|
23
|
+
TreasureTrove::TREASURES.size.should == 6
|
24
|
+
end
|
25
|
+
|
26
|
+
it "has a pie worth 5 points" do
|
27
|
+
TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "has a bottle worth 25 points" do
|
31
|
+
TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "has a hammer worth 50 points" do
|
35
|
+
TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "has a skillet worth 100 points" do
|
39
|
+
TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "has a broomstick worth 200 points" do
|
43
|
+
TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "has a crowbar worth 400 points" do
|
47
|
+
TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative 'treasure_trove'
|
2
|
+
|
3
|
+
module StudioGame
|
4
|
+
describe Treasure do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@treasure = Treasure.new(:hammer, 50)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "has a name attribute" do
|
11
|
+
@treasure.name.should == :hammer
|
12
|
+
end
|
13
|
+
|
14
|
+
it "has a points attribute" do
|
15
|
+
@treasure.value.should == 50
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
describe TreasureTrove do
|
21
|
+
|
22
|
+
it "has six treasures" do
|
23
|
+
TreasureTrove::TREASURES.size.should == 6
|
24
|
+
end
|
25
|
+
|
26
|
+
it "has a pie worth 5 points" do
|
27
|
+
TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "has a bottle worth 25 points" do
|
31
|
+
TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "has a hammer worth 50 points" do
|
35
|
+
TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "has a skillet worth 100 points" do
|
39
|
+
TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "has a broomstick worth 200 points" do
|
43
|
+
TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "has a crowbar worth 400 points" do
|
47
|
+
TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: studio_game_abr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Abe Rios
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: |
|
28
|
+
Players embark on a journey to score the highest out of all their friends.
|
29
|
+
Along the way, players will encounter danger and assistance, and find many treasures, increasing their points.
|
30
|
+
Good Luck and Happy Playing!!!
|
31
|
+
email: arios10101@mygame.com
|
32
|
+
executables:
|
33
|
+
- studio_game
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- LICENSE
|
38
|
+
- README
|
39
|
+
- bin/high_scores.txt
|
40
|
+
- bin/player.csv
|
41
|
+
- bin/player.csv~
|
42
|
+
- bin/studio_game
|
43
|
+
- bin/studio_game.rb~
|
44
|
+
- bin/studio_game~
|
45
|
+
- lib/studio_game/auditable.rb
|
46
|
+
- lib/studio_game/berserk_player.rb
|
47
|
+
- lib/studio_game/clumsy_player.rb
|
48
|
+
- lib/studio_game/die.rb
|
49
|
+
- lib/studio_game/files.rb
|
50
|
+
- lib/studio_game/game.rb
|
51
|
+
- lib/studio_game/game_turn.rb
|
52
|
+
- lib/studio_game/items.rb
|
53
|
+
- lib/studio_game/iterators.rb
|
54
|
+
- lib/studio_game/loaded_die.rb
|
55
|
+
- lib/studio_game/playable.rb
|
56
|
+
- lib/studio_game/player.rb
|
57
|
+
- lib/studio_game/treasure_trove.rb
|
58
|
+
- spec/studio_game/berserk_player_spec.rb
|
59
|
+
- spec/studio_game/berserk_player_spec.rb~
|
60
|
+
- spec/studio_game/clumsy_player_spec.rb
|
61
|
+
- spec/studio_game/clumsy_player_spec.rb~
|
62
|
+
- spec/studio_game/game_spec.rb
|
63
|
+
- spec/studio_game/game_spec.rb~
|
64
|
+
- spec/studio_game/player_spec.rb
|
65
|
+
- spec/studio_game/player_spec.rb~
|
66
|
+
- spec/studio_game/treasure_trove_spec.rb
|
67
|
+
- spec/studio_game/treasure_trove_spec.rb~
|
68
|
+
homepage: http://mygamepr.com
|
69
|
+
licenses:
|
70
|
+
- MIT
|
71
|
+
metadata: {}
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options: []
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.9'
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
requirements: []
|
87
|
+
rubyforge_project:
|
88
|
+
rubygems_version: 2.4.5.1
|
89
|
+
signing_key:
|
90
|
+
specification_version: 4
|
91
|
+
summary: Players compete for the highest points in a luck based game.
|
92
|
+
test_files:
|
93
|
+
- spec/studio_game/berserk_player_spec.rb
|
94
|
+
- spec/studio_game/game_spec.rb~
|
95
|
+
- spec/studio_game/clumsy_player_spec.rb
|
96
|
+
- spec/studio_game/berserk_player_spec.rb~
|
97
|
+
- spec/studio_game/clumsy_player_spec.rb~
|
98
|
+
- spec/studio_game/treasure_trove_spec.rb
|
99
|
+
- spec/studio_game/player_spec.rb
|
100
|
+
- spec/studio_game/player_spec.rb~
|
101
|
+
- spec/studio_game/treasure_trove_spec.rb~
|
102
|
+
- spec/studio_game/game_spec.rb
|