pats_studio_game 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: edd4f9c6245fa311e6f2f3d9d6a318b696854d36
4
+ data.tar.gz: be65926082b82f2ac203c091593a452672158fb1
5
+ SHA512:
6
+ metadata.gz: 472df563b84112c0d77c3be3ddd6961387feb76367562d1d36f5ad99915be9ac8b0730510547aff7cdb6491e65c85796770947b3a73b727fda34215e821fe02d
7
+ data.tar.gz: 732d7d5c16e44899324333b3b3c8312523ddd8493308b640380b174dd65441c0be94dad57d63b586384149bc6445c034e993939d3016667b81ce626e3f402f83
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ Copyright (c) 2015 Patrick Wey
2
+
3
+
4
+ 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:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ 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,5 @@
1
+ This is a game developed during the Pragmatic Studio Ruby course.
2
+
3
+ After running the game, the user is prompted for the number of game rounds. Each round, players are strengthened or weakened based on their type and the roll of a die. Additionally, players find treasures at random each round.
4
+
5
+ At the end of the specified number of rounds, the user can type 'quit' to view player statistics.
data/bin/players.csv ADDED
@@ -0,0 +1,3 @@
1
+ Alvin,100
2
+ Simon,60
3
+ Theo,125
data/bin/studio_game ADDED
@@ -0,0 +1,33 @@
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/die'
6
+ require_relative '../lib/studio_game/clumsy_player'
7
+ require_relative '../lib/studio_game/berserk_player'
8
+
9
+ game = StudioGame::Game.new("Knuckleheads")
10
+ default_player_file = File.join(File.dirname(__FILE__), 'players.csv')
11
+ game.load_players(ARGV.shift || default_player_file)
12
+
13
+ clumsy_player = StudioGame::ClumsyPlayer.new("klutz")
14
+ game.add_player(clumsy_player)
15
+
16
+ berserk_player = StudioGame::BerserkPlayer.new("berzy")
17
+ game.add_player(berserk_player)
18
+
19
+ loop do
20
+ puts "\nHow many rounds? ('quit' to exit)"
21
+ rounds = gets.chomp.downcase
22
+ case rounds
23
+ when /^\d+$/
24
+ game.play(rounds.to_i)
25
+ when 'quit' , 'exit'
26
+ game.print_stats
27
+ break
28
+ else
29
+ puts "Please enter a number or type 'quit' to exit"
30
+ end
31
+ end
32
+
33
+ game.save_highscores
@@ -0,0 +1,7 @@
1
+ module StudioGame
2
+ module Auditable
3
+ def audit
4
+ puts "Rolled a #{self.number} (#{self.class})"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,32 @@
1
+ require_relative 'player'
2
+
3
+ module StudioGame
4
+ class BerserkPlayer < Player
5
+ def initialize(name, health=100)
6
+ super(name, health)
7
+ @w00t_count = 0
8
+ end
9
+
10
+ def w00t
11
+ super
12
+ puts "#{@name} is berserk!" if berserk?
13
+ @w00t_count += 1
14
+ end
15
+
16
+ def blam
17
+ berserk? ? w00t : super
18
+ end
19
+
20
+ def berserk?
21
+ @w00t_count > 5
22
+ end
23
+ end
24
+
25
+
26
+ if __FILE__ == $0
27
+ berserker = BerserkPlayer.new("berserker", 50)
28
+ 6.times { berserker.w00t }
29
+ 2.times { berserker.blam }
30
+ puts berserker.health
31
+ end
32
+ end
@@ -0,0 +1,40 @@
1
+ require_relative 'player'
2
+ require_relative 'treasure_trove'
3
+
4
+ module StudioGame
5
+ class ClumsyPlayer < Player
6
+ def initialize(name, health=100)
7
+ super(name, health)
8
+ @clumsiness = 2
9
+ @health_bonus = 20
10
+ end
11
+ def broken_treasure_points(treasure)
12
+ treasure.points / @clumsiness
13
+ end
14
+ def found_treasure(treasure)
15
+ super(Treasure.new(treasure.name, broken_treasure_points(treasure)))
16
+ end
17
+ def w00t
18
+ @health += @health_bonus
19
+ super
20
+ puts "#{@name} got a health bonus of #{@health_bonus} for being clumsy!"
21
+ end
22
+ end
23
+
24
+ if __FILE__ == $0
25
+ clumsy = ClumsyPlayer.new("klutz")
26
+
27
+ hammer = Treasure.new(:hammer, 50)
28
+ clumsy.found_treasure(hammer)
29
+ clumsy.found_treasure(hammer)
30
+ clumsy.found_treasure(hammer)
31
+
32
+ crowbar = Treasure.new(:crowbar, 400)
33
+ clumsy.found_treasure(crowbar)
34
+
35
+ clumsy.each_found_treasure do |treasure|
36
+ puts "#{treasure.points} total #{treasure.name} points"
37
+ end
38
+ puts "#{clumsy.points} grand total points"
39
+ end
40
+ end
@@ -0,0 +1,14 @@
1
+ require_relative 'auditable'
2
+
3
+ module StudioGame
4
+ class Die
5
+ include Auditable
6
+ attr_reader :number
7
+
8
+ def roll
9
+ @number = rand(1..6)
10
+ audit
11
+ @number
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,101 @@
1
+ require 'csv'
2
+ require_relative 'player'
3
+ require_relative 'game_turn'
4
+ require_relative 'treasure_trove'
5
+
6
+ module StudioGame
7
+ class Game
8
+ attr_reader :title
9
+
10
+ def initialize(title)
11
+ @title = title.capitalize
12
+ @players = []
13
+ end
14
+ def add_player(name)
15
+ @players << name
16
+ end
17
+ def play(rounds)
18
+ puts "There are #{@players.size} players in #{@title}:"
19
+ @players.each do |player|
20
+ puts player
21
+ end
22
+
23
+ treasures = TreasureTrove::TREASURES
24
+ puts "\nThere are #{treasures.size} treasures to be found:"
25
+ treasures.each do |treasure|
26
+ puts "A #{treasure.name} is worth #{treasure.points}"
27
+ end
28
+
29
+ 1.upto(rounds) do |round|
30
+ if block_given?
31
+ break if yield
32
+ end
33
+ puts "\nRound #{round}:"
34
+ @players.each do |player|
35
+ GameTurn.take_turn(player)
36
+ puts player
37
+ end
38
+ end
39
+ end
40
+ def print_name_and_health(player)
41
+ puts "#{player.name} (#{player.health})"
42
+ end
43
+ def high_score_entry(player)
44
+ "#{player.name.ljust(20, '.')} #{player.score}"
45
+ end
46
+ def print_stats
47
+ puts "\n#{@title} Statistics:"
48
+ strong, wimpy = @players.partition {|player| player.strong?}
49
+
50
+ puts "\n#{strong.size} strong players:"
51
+ strong.each do |player|
52
+ print_name_and_health(player)
53
+ end
54
+
55
+ puts "\n#{wimpy.size} wimpy players:"
56
+ wimpy.each do |player|
57
+ print_name_and_health(player)
58
+ end
59
+
60
+ @players.each do |player|
61
+ puts "\n#{player.name}'s point totals:"
62
+ player.each_found_treasure do |treasure|
63
+ puts "#{treasure.points} total #{treasure.name} points"
64
+ end
65
+ puts "#{player.points} grand total points"
66
+ end
67
+
68
+ puts "\n#{total_points} total points from treasure found."
69
+
70
+ puts "\n#{@title} High Scores:"
71
+ @players.sort.each do |player|
72
+ puts high_score_entry(player)
73
+ end
74
+ end
75
+ def total_points
76
+ @players.reduce(0) { |total, player| total += player.points }
77
+ end
78
+ def load_players(from_file)
79
+ CSV.foreach(from_file) do |row|
80
+ add_player(Player.new(row[0], row[1].to_i))
81
+ end
82
+ end
83
+ def save_highscores(to_file="highscores.txt")
84
+ File.open(to_file, "w") do |file|
85
+ file.puts "#{@title} Highscores:"
86
+ @players.sort.each do |player|
87
+ file.puts high_score_entry(player)
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ if __FILE__ == $0
94
+ game = Game.new("chess")
95
+ puts game.title
96
+ game.add_player(Player.new("linus"))
97
+ game.add_player(Player.new("lucy", 50))
98
+ game.play(2)
99
+ game.print_stats
100
+ end
101
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'die'
2
+ require_relative 'loaded_die'
3
+ require_relative 'player'
4
+ require_relative 'treasure_trove'
5
+
6
+ module StudioGame
7
+ module GameTurn
8
+ def self.take_turn(player)
9
+ die = Die.new #LoadedDie.new for a fixed game
10
+
11
+ case die.roll
12
+ when 1..2
13
+ player.blam
14
+ when 3..4
15
+ puts "#{player.name} was skipped."
16
+ else
17
+ player.w00t
18
+ end
19
+ treasure = TreasureTrove.random
20
+ player.found_treasure(treasure)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ Knuckleheads Highscores:
2
+ Berzy............... 955
3
+ Simon............... 760
4
+ Alvin............... 560
5
+ Theo................ 495
6
+ Klutz............... 369
@@ -0,0 +1,14 @@
1
+ require_relative 'auditable'
2
+
3
+ module StudioGame
4
+ class LoadedDie
5
+ include Auditable
6
+ attr_reader :number
7
+ def roll
8
+ numbers = [1, 1, 2, 5, 6, 6]
9
+ @number = numbers.sample
10
+ audit
11
+ @number
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module StudioGame
2
+ module Playable
3
+ def blam
4
+ self.health -= 10
5
+ puts "#{name} got blammed!"
6
+ end
7
+ def w00t
8
+ self.health += 15
9
+ puts "#{name} got w00ted!"
10
+ end
11
+ def strong?
12
+ health > 100
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,51 @@
1
+ require_relative 'playable'
2
+
3
+ module StudioGame
4
+ class Player
5
+ include Playable
6
+ attr_accessor :name
7
+ attr_accessor :health
8
+
9
+ def initialize(name, health=100)
10
+ @name = name.capitalize
11
+ @health = health
12
+ @found_treasures = Hash.new(0)
13
+ end
14
+ def to_s
15
+ "I'm #{@name} with a health = #{@health}, points = #{points}, and score = #{score}"
16
+ end
17
+ def name=(new_name)
18
+ @name = new_name.capitalize
19
+ end
20
+
21
+ def score
22
+ @health + points
23
+ end
24
+
25
+ def <=>(other)
26
+ other.score <=> score
27
+ end
28
+ def found_treasure(treasure)
29
+ @found_treasures[treasure.name] += treasure.points
30
+ puts "#{@name} found a #{treasure.name} worth #{treasure.points}."
31
+ end
32
+ def points
33
+ @found_treasures.values.reduce(0, :+)
34
+ end
35
+ def each_found_treasure
36
+ @found_treasures.each do |name, points|
37
+ yield Treasure.new(name, points)
38
+ end
39
+ end
40
+ end
41
+
42
+ if __FILE__ == $0
43
+ player = Player.new("moe")
44
+ puts player.name
45
+ puts player.health
46
+ player.blam
47
+ puts player.health
48
+ player.w00t
49
+ puts player.health
50
+ end
51
+ end
@@ -0,0 +1,18 @@
1
+ module StudioGame
2
+ Treasure = Struct.new(:name, :points)
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
@@ -0,0 +1,27 @@
1
+ require 'studio_game/player'
2
+ require 'studio_game/berserk_player'
3
+
4
+ module StudioGame
5
+ describe BerserkPlayer do
6
+ before do
7
+ $stdout = StringIO.new
8
+ @initial_health = 50
9
+ @player = BerserkPlayer.new("berserker", @initial_health)
10
+ end
11
+
12
+ it "does not go berserk if w00ted 5 times" do
13
+ 1.upto(5) {@player.w00t}
14
+ @player.berserk?.should be_false
15
+ end
16
+ it "goes berserk when w00ted more than 5 times" do
17
+ 1.upto(6) {@player.w00t}
18
+ @player.berserk?.should be_true
19
+ end
20
+ it "gets w00ted instead of blammed when it's gone berserk" do
21
+ 1.upto(6) {@player.w00t}
22
+ 1.upto(2) {@player.blam}
23
+
24
+ @player.health.should == @initial_health + (8 * 15)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,41 @@
1
+ require 'studio_game/clumsy_player'
2
+ require 'studio_game/player'
3
+ require 'studio_game/treasure_trove'
4
+
5
+ module StudioGame
6
+ describe ClumsyPlayer do
7
+ before do
8
+ $stdout = StringIO.new
9
+ @initial_health = 100
10
+ @health_bonus = 20
11
+ @player = ClumsyPlayer.new("klumsy", @initial_health)
12
+ end
13
+ it "gets half the points for treasures" do
14
+ @player.points.should == 0
15
+
16
+ hammer = Treasure.new(:hammer, 50)
17
+ @player.found_treasure(hammer)
18
+ @player.found_treasure(hammer)
19
+ @player.found_treasure(hammer)
20
+
21
+ @player.points.should == 75
22
+
23
+ crowbar = Treasure.new(:crowbar, 400)
24
+ @player.found_treasure(crowbar)
25
+
26
+ @player.points.should == 275
27
+
28
+ yielded = []
29
+ @player.each_found_treasure do |treasure|
30
+ yielded << treasure
31
+ end
32
+
33
+ yielded.should == [Treasure.new(:hammer, 75), Treasure.new(:crowbar, 200)]
34
+ end
35
+
36
+ it "gets extra health when w00ted" do
37
+ 2.times { @player.w00t }
38
+ @player.health.should == @initial_health + 30 + (@health_bonus * 2)
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,69 @@
1
+ require 'studio_game/game'
2
+ require 'studio_game/player'
3
+ require 'studio_game/die'
4
+
5
+ module StudioGame
6
+ describe Game do
7
+ before do
8
+ $stdout = StringIO.new
9
+
10
+ @game = Game.new("Knuckleheads")
11
+ @initial_health = 100
12
+ @rounds = 2
13
+
14
+ @player = Player.new("moe", @initial_health)
15
+
16
+ @game.add_player(@player)
17
+ end
18
+
19
+ it "w00ts the player if a high number is rolled" do
20
+ Die.any_instance.stub(:roll).and_return(5)
21
+
22
+ @game.play(@rounds)
23
+
24
+ @player.health.should == @initial_health + (15 * @rounds)
25
+ end
26
+
27
+ it "skips the player if a medium number is rolled" do
28
+ Die.any_instance.stub(:roll).and_return(3)
29
+ @game.play(@rounds)
30
+ @player.health.should == @initial_health
31
+ end
32
+
33
+ it "blams the player if a low number is rolled" do
34
+ Die.any_instance.stub(:roll).and_return(1)
35
+ @game.play(@rounds)
36
+ @player.health.should == @initial_health - (10 * @rounds)
37
+ end
38
+
39
+ it "assigns a treasure for points during a player's turn" do
40
+ game = Game.new("Knuckleheads")
41
+ player = Player.new("moe")
42
+
43
+ game.add_player(player)
44
+
45
+ game.play(1)
46
+
47
+ player.points.should_not be_zero
48
+
49
+ # or use alternate expectation syntax:
50
+ # expect(player.points).not_to be_zero
51
+ end
52
+
53
+ it "computes total points as the sum of all player points" do
54
+ game = Game.new("Knuckleheads")
55
+
56
+ player1 = Player.new("moe")
57
+ player2 = Player.new("larry")
58
+
59
+ game.add_player(player1)
60
+ game.add_player(player2)
61
+
62
+ player1.found_treasure(Treasure.new(:hammer, 50))
63
+ player1.found_treasure(Treasure.new(:hammer, 50))
64
+ player2.found_treasure(Treasure.new(:crowbar, 400))
65
+
66
+ game.total_points.should == 500
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,123 @@
1
+ require 'studio_game/player'
2
+ require 'studio_game/treasure_trove'
3
+
4
+ module StudioGame
5
+ describe Player do
6
+ before do
7
+ $stdout = StringIO.new
8
+ # keeps studio_game.rb output from mingling with rspec output
9
+ @initial_health = 150
10
+ @player = Player.new("moe", @initial_health)
11
+ end
12
+
13
+ it "has a capitalized name" do
14
+ @player.name.should == "Moe"
15
+ # expect(@player.name).to eq("Moe")
16
+ end
17
+
18
+ it "has a string representation" do
19
+ @player.found_treasure(Treasure.new(:hammer, 50))
20
+ @player.to_s.should == "I'm Moe with a health = 150, points = 50, and score = 200"
21
+ end
22
+ it "computes a score as a sum of health and points" do
23
+ @player.found_treasure(Treasure.new(:hammer, 50))
24
+ @player.found_treasure(Treasure.new(:hammer, 50))
25
+
26
+ @player.score.should == 250
27
+ end
28
+ it "increases health by 15 when w00ted" do
29
+ @player.w00t
30
+ @player.health.should == @initial_health + 15
31
+ # expect(@player.health).to eq(@initial_health + 15)
32
+ end
33
+ it "decreases health by 10 when blammed" do
34
+ @player.blam
35
+ @player.health.should == @initial_health - 10
36
+ # expect(@player.health).to eq(@initial_health - 10)
37
+ end
38
+
39
+ it "computes points as the sum of all treasure points" do
40
+ @player.points.should == 0
41
+
42
+ @player.found_treasure(Treasure.new(:hammer, 50))
43
+
44
+ @player.points.should == 50
45
+
46
+ @player.found_treasure(Treasure.new(:crowbar, 400))
47
+
48
+ @player.points.should == 450
49
+
50
+ @player.found_treasure(Treasure.new(:hammer, 50))
51
+
52
+ @player.points.should == 500
53
+ end
54
+
55
+ it "yields each found treasure and its total points" do
56
+ @player.found_treasure(Treasure.new(:skillet, 100))
57
+ @player.found_treasure(Treasure.new(:skillet, 100))
58
+ @player.found_treasure(Treasure.new(:hammer, 50))
59
+ @player.found_treasure(Treasure.new(:bottle, 5))
60
+ @player.found_treasure(Treasure.new(:bottle, 5))
61
+ @player.found_treasure(Treasure.new(:bottle, 5))
62
+ @player.found_treasure(Treasure.new(:bottle, 5))
63
+ @player.found_treasure(Treasure.new(:bottle, 5))
64
+
65
+ yielded = []
66
+ @player.each_found_treasure do |treasure|
67
+ yielded << treasure
68
+ end
69
+
70
+ yielded.should == [
71
+ Treasure.new(:skillet, 200),
72
+ Treasure.new(:hammer, 50),
73
+ Treasure.new(:bottle, 25)
74
+ ]
75
+ end
76
+
77
+ context "created with a default health" do
78
+ before do
79
+ @player = Player.new("moe")
80
+ end
81
+ it "has an initial health of 100" do
82
+ @player.health.should == 100
83
+ # expect(@player.health).to eq(100)
84
+ end
85
+ end
86
+
87
+ context "player with a health of 150" do
88
+ before do
89
+ @initial_health = 150
90
+ @player = Player.new("pat", @initial_health)
91
+ end
92
+ it "is strong" do
93
+ @player.should be_strong
94
+ # expect(@player).to be_strong
95
+ end
96
+ end
97
+
98
+ context "player with a health of 100" do
99
+ before do
100
+ @initial_health = 100
101
+ @player = Player.new("wuss", @initial_health)
102
+ end
103
+
104
+ it "is wimpy" do
105
+ @player.should_not be_strong
106
+ # expect(@player).not_to be_strong
107
+ end
108
+ end
109
+ context "in a collection of players" do
110
+ before do
111
+ @player1 = Player.new("moe", 100)
112
+ @player2 = Player.new("larry", 200)
113
+ @player3 = Player.new("curly", 300)
114
+
115
+ @players = [@player1, @player2, @player3]
116
+ end
117
+
118
+ it "is sorted by decreasing score" do
119
+ @players.sort.should == [@player3, @player2, @player1]
120
+ end
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,58 @@
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.points.should == 50
16
+ end
17
+ end
18
+
19
+ describe TreasureTrove do
20
+
21
+ it "has six treasures" do
22
+ TreasureTrove::TREASURES.size.should == 6
23
+ end
24
+
25
+ it "has a pie worth 5 points" do
26
+ TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
27
+ end
28
+
29
+ it "has a bottle worth 25 points" do
30
+ TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
31
+ end
32
+
33
+ it "has a hammer worth 50 points" do
34
+ TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
35
+ end
36
+
37
+ it "has a skillet worth 100 points" do
38
+ TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
39
+ end
40
+
41
+ it "has a broomstick worth 200 points" do
42
+ TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
43
+ end
44
+
45
+ it "has a crowbar worth 400 points" do
46
+ TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
47
+ end
48
+
49
+ it "returns a random treasure" do
50
+ treasure = TreasureTrove.random
51
+
52
+ TreasureTrove::TREASURES.should include(treasure)
53
+
54
+ # or use alternate expectation syntax:
55
+ # expect(TreasureTrove::TREASURES).to include(treasure)
56
+ end
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pats_studio_game
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Wey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-07 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: "This is a game developed during the Pragmatic Studio Ruby course. \n\nAfter
28
+ running the game, the user is prompted for the number of game rounds. Each round,
29
+ players are strengthened or weakened based on their type and the roll of a die.
30
+ Additionally, players find treasures at random each round.\n\nAt the end of the
31
+ specified number of rounds, the user can type 'quit' to view player statistics."
32
+ email: patrickwey@gmail.com
33
+ executables:
34
+ - studio_game
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - bin/players.csv
39
+ - bin/studio_game
40
+ - lib/studio_game/auditable.rb
41
+ - lib/studio_game/berserk_player.rb
42
+ - lib/studio_game/clumsy_player.rb
43
+ - lib/studio_game/die.rb
44
+ - lib/studio_game/game.rb
45
+ - lib/studio_game/game_turn.rb
46
+ - lib/studio_game/highscores.txt
47
+ - lib/studio_game/loaded_die.rb
48
+ - lib/studio_game/playable.rb
49
+ - lib/studio_game/player.rb
50
+ - lib/studio_game/treasure_trove.rb
51
+ - spec/studio_game/berserk_player_spec.rb
52
+ - spec/studio_game/clumsy_player_spec.rb
53
+ - spec/studio_game/game_spec.rb
54
+ - spec/studio_game/player_spec.rb
55
+ - spec/studio_game/treasure_trove_spec.rb
56
+ - LICENSE
57
+ - README
58
+ homepage: ''
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '1.9'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.0.14
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: A randomized round-based game
82
+ test_files:
83
+ - spec/studio_game/berserk_player_spec.rb
84
+ - spec/studio_game/clumsy_player_spec.rb
85
+ - spec/studio_game/game_spec.rb
86
+ - spec/studio_game/player_spec.rb
87
+ - spec/studio_game/treasure_trove_spec.rb