rf_2016_studio_game 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8e6c0d4021c082d32962f4e05721df6bf6e014af
4
+ data.tar.gz: 20b60ff9a1be941da6cde3a16ab93fb72f67073f
5
+ SHA512:
6
+ metadata.gz: bec5bcd4b1f05a1a6133d113abaa9ac96c2e09a7635c1e8149349b7bead674a7ecdbb232b7cf6465d299947d26f8a5212db38b72c3e8a851cde803d8b6b2a7ac
7
+ data.tar.gz: 3b04cf6ba5a0d2828708f3a9b8caafbaf321c0d8ad1797263ee0e7c4597dbdea4b1e9daf71a8e2af77bce2f86c00e272fb13d1af9714259db66de8edfdb68f4b
data/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Copyright (c) 2015 Ryan Flach
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in the
5
+ Software without restriction, including without limitation the rights to use, copy,
6
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7
+ and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all
10
+ copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,5 @@
1
+ studio_game is a command-line game built through instruction by The Pragmatic Studio.
2
+
3
+ Through user input, the game is named and then run through a number of designated rounds.
4
+ Random play is introduced to assign treasure (points) and increase or decrease a player's health.
5
+ At the conclusion of the game (as determined by the user) a .txt file is saved with the high scores.
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,34 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/studio_game/player'
4
+ require_relative '../lib/studio_game/game'
5
+ require_relative '../lib/studio_game/clumsy_player'
6
+ require_relative '../lib/studio_game/berserk_player'
7
+
8
+ puts "Please enter the name of this game."
9
+ game = gets.chomp.to_s
10
+ game = StudioGame::Game.new("#{game}")
11
+ default_player_file = File.join(File.dirname(__FILE__), 'players.csv')
12
+ game.load_players(ARGV.shift || default_player_file)
13
+
14
+ clumsy1 = StudioGame::ClumsyPlayer.new("klutz", 105, 3)
15
+ game.add_player(clumsy1)
16
+
17
+ berserk1 = StudioGame::BerserkPlayer.new("berserker", 50)
18
+ game.add_player(berserk1)
19
+
20
+ loop do
21
+ puts "\nHow many game rounds? ('quit' to exit)"
22
+ answer = gets.chomp.downcase
23
+ case answer
24
+ when /^\d+$/
25
+ game.play(answer.to_i)
26
+ when 'quit', 'exit'
27
+ game.print_stats
28
+ break
29
+ else
30
+ puts "Please enter a number or 'quit'"
31
+ end
32
+ end
33
+
34
+ game.save_high_scores
@@ -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,35 @@
1
+ require_relative 'player'
2
+
3
+ module StudioGame
4
+ class BerserkPlayer < Player
5
+ def initialize(name, health=100)
6
+ super(name, health)
7
+ @woot_count = 0
8
+ end
9
+
10
+ def berserk?
11
+ @woot_count > 5
12
+ end
13
+
14
+ def woot
15
+ super
16
+ @woot_count += 1
17
+ puts "#{@name} is berserk!" if berserk?
18
+ end
19
+
20
+ def blam
21
+ if berserk?
22
+ woot
23
+ else
24
+ super
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+ if __FILE__ == $0
31
+ berserker = BerserkPlayer.new("berserker", 50)
32
+ 6.times { berserker.woot }
33
+ 2.times { berserker.blam }
34
+ puts berserker.health
35
+ end
@@ -0,0 +1,38 @@
1
+ require_relative 'player'
2
+
3
+ module StudioGame
4
+ class ClumsyPlayer < Player
5
+ attr_reader :boost_factor
6
+
7
+ def initialize(name, health=100, boost_factor=1)
8
+ super(name, health)
9
+ @boost_factor = boost_factor
10
+ end
11
+
12
+ def found_treasure(treasure)
13
+ damaged_treasure = Treasure.new(treasure.name, treasure.points / 2)
14
+ super(damaged_treasure)
15
+ end
16
+
17
+ def woot
18
+ @boost_factor.times { super }
19
+ end
20
+ end
21
+
22
+ if __FILE__ == $0
23
+ clumsy = ClumsyPlayer.new("klutz")
24
+
25
+ hammer = Treasure.new(:hammer, 50)
26
+ clumsy.found_treasure(hammer)
27
+ clumsy.found_treasure(hammer)
28
+ clumsy.found_treasure(hammer)
29
+
30
+ crowbar = Treasure.new(:crowbar, 400)
31
+ clumsy.found_treasure(crowbar)
32
+
33
+ clumsy.each_found_treasure do |treasure|
34
+ puts "#{treasure.points} total #{treasure.name} points"
35
+ end
36
+ puts "#{clumsy.points} grand total points"
37
+ end
38
+ end
@@ -0,0 +1,18 @@
1
+ require_relative 'auditable'
2
+
3
+ module StudioGame
4
+ class Die
5
+ include Auditable
6
+ attr_reader :number
7
+
8
+ def initialize
9
+ roll
10
+ end
11
+
12
+ def roll
13
+ @number = rand(1..6)
14
+ audit
15
+ @number
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,103 @@
1
+ require_relative 'player'
2
+ require_relative 'die'
3
+ require_relative 'game_turn'
4
+ require_relative 'treasure_trove'
5
+ require 'csv'
6
+
7
+
8
+ module StudioGame
9
+ class Game
10
+
11
+ attr_reader :title
12
+
13
+ def initialize(title)
14
+ @title = title
15
+ @players = []
16
+ end
17
+
18
+ def load_players(from_file)
19
+ CSV.foreach(from_file) do |row|
20
+ player = Player.new(row[0], row[1].to_i)
21
+ add_player(player)
22
+ end
23
+ end
24
+
25
+ def save_high_scores(to_file="high_scores.txt")
26
+ File.open(to_file, "w") do |file|
27
+ file.puts "#{@title} High Scores:"
28
+ @players.sort.each do |player|
29
+ file.puts high_score_entry(player)
30
+ end
31
+ end
32
+ end
33
+
34
+ def add_player(a_player)
35
+ @players << a_player
36
+ end
37
+
38
+ def play(rounds)
39
+ puts "There are #{@players.size} players in #{@title}:"
40
+ @players.each do |player|
41
+ puts player
42
+ end
43
+ treasures = TreasureTrove::TREASURES
44
+ puts "\nThere are #{treasures.size} treasures to be found:"
45
+ treasures.each do |treasure|
46
+ puts "A #{treasure.name} is worth #{treasure.points} points"
47
+ end
48
+ 1.upto(rounds) do |round|
49
+ if block_given?
50
+ break if yield
51
+ end
52
+ puts "\nRound #{round}:"
53
+ @players.each do |player|
54
+ GameTurn.take_turn(player)
55
+ puts player
56
+ end
57
+ end
58
+ end
59
+
60
+ def print_name_and_health(player)
61
+ puts "#{player.name} (#{player.health})"
62
+ end
63
+
64
+ def total_points
65
+ @players.reduce(0) { |sum, player| sum + player.points }
66
+ end
67
+
68
+ def high_score_entry(player)
69
+ formatted_name = player.name.ljust(20,'.')
70
+ "#{formatted_name} #{player.score}"
71
+ end
72
+
73
+ def print_stats
74
+ strong_players, wimpy_players = @players.partition { |player| player.strong? }
75
+
76
+ puts "\n#{@title} statistics:"
77
+
78
+ puts "\n#{strong_players.size} strong players:"
79
+ strong_players.each do |player|
80
+ print_name_and_health(player)
81
+ end
82
+ puts "\n#{wimpy_players.size} wimpy players:"
83
+ wimpy_players.each do |player|
84
+ print_name_and_health(player)
85
+ end
86
+
87
+ puts "#{total_points} total points from treasures found"
88
+
89
+ @players.sort.each do |player|
90
+ puts "\n#{player.name}'s point totals:"
91
+ puts "#{player.score} grand total points"
92
+ player.each_found_treasure do |treasure|
93
+ puts "#{treasure.points} total #{treasure.name} points"
94
+ end
95
+ end
96
+
97
+ puts "\n#{@title} High Scores:"
98
+ @players.sort.each do |player|
99
+ puts high_score_entry(player)
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,21 @@
1
+ require_relative 'die'
2
+ require_relative 'player'
3
+ require_relative 'treasure_trove'
4
+
5
+ module StudioGame
6
+ module GameTurn
7
+ def self.take_turn(player)
8
+ die = Die.new
9
+ case die.roll
10
+ when 1..2
11
+ player.blam
12
+ when 3..4
13
+ puts "#{player.name} was skipped."
14
+ else
15
+ player.woot
16
+ end
17
+ treasure = TreasureTrove.random
18
+ player.found_treasure(treasure)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'auditable'
2
+
3
+ module StudioGame
4
+ class LoadedDie
5
+ include Auditable
6
+ attr_reader :number
7
+
8
+ def roll
9
+ numbers = [1, 1, 2, 5, 6, 6]
10
+ @number = numbers.sample
11
+ audit
12
+ @number
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module StudioGame
2
+ module Playable
3
+ def woot
4
+ self.health += 15
5
+ puts "#{name} got w00ted!"
6
+ end
7
+
8
+ def blam
9
+ self.health -= 10
10
+ puts "#{name} got blammed!"
11
+ end
12
+
13
+ def strong?
14
+ health > 100
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,57 @@
1
+ require_relative 'treasure_trove'
2
+ require_relative 'playable'
3
+
4
+ module StudioGame
5
+ class Player
6
+ include Playable
7
+ attr_accessor :name, :health
8
+
9
+ def initialize(name, health=100)
10
+ @name = name.capitalize
11
+ @health = health
12
+ @found_treasures = Hash.new(0)
13
+ end
14
+
15
+ def name=(new_name)
16
+ @name = new_name.capitalize
17
+ end
18
+
19
+ def to_s
20
+ "I'm #{@name} with health = #{@health}, points = #{points}, and score = #{score}."
21
+ end
22
+
23
+ def score
24
+ @health + points
25
+ end
26
+
27
+ def <=>(other)
28
+ other.score <=> score
29
+ end
30
+
31
+ def found_treasure(treasure)
32
+ @found_treasures[treasure.name] += treasure.points
33
+ puts "#{@name} found a #{treasure.name} worth #{treasure.points} points."
34
+ puts "#{@name}'s treasures: #{@found_treasures}"
35
+ end
36
+
37
+ def points
38
+ @found_treasures.values.reduce(0, :+)
39
+ end
40
+
41
+ def each_found_treasure
42
+ @found_treasures.each do |name, points|
43
+ yield Treasure.new(name, points)
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ if __FILE__ == $0
50
+ player = Player.new('moe')
51
+ puts player.name
52
+ puts player.health
53
+ player.woot
54
+ puts player.health
55
+ player.blam
56
+ puts player.health
57
+ end
@@ -0,0 +1,20 @@
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
+
18
+ end
19
+
20
+ end
@@ -0,0 +1,37 @@
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.woot }
13
+
14
+ @player.berserk?.should be_false
15
+
16
+ # or if using Rspec 3.0:
17
+ # @player.berserk?.should be_falsey
18
+ end
19
+
20
+ it "goes berserk when w00ted more than 5 times" do
21
+ 1.upto(6) { @player.woot }
22
+
23
+ @player.berserk?.should be_true
24
+
25
+ # or if using Rspec 3.0:
26
+ # @player.berserk?.should be_truthy
27
+ end
28
+
29
+ it "gets w00ted instead of blammed when it's gone berserk" do
30
+ 1.upto(6) { @player.woot }
31
+ 1.upto(2) { @player.blam }
32
+
33
+ @player.health.should == @initial_health + (8 * 15)
34
+ end
35
+
36
+ end
37
+ end
@@ -0,0 +1,50 @@
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
+ 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
+ end
50
+ end
@@ -0,0 +1,61 @@
1
+ require 'studio_game/game'
2
+
3
+ module StudioGame
4
+ describe Game do
5
+
6
+ before do
7
+ @game = Game.new("Knuckleheads")
8
+
9
+ @initial_health = 100
10
+ @player = Player.new("moe", @initial_health)
11
+
12
+ @game.add_player(@player)
13
+ end
14
+
15
+ it "woots the player if a high number is rolled" do
16
+ Die.any_instance.stub(:roll).and_return(5)
17
+ @game.play(2)
18
+ @player.health.should == @initial_health + (15 * 2)
19
+ end
20
+
21
+ it "skips the player if a medium number is rolled" do
22
+ Die.any_instance.stub(:roll).and_return(3)
23
+ @game.play(2)
24
+ @player.health.should == @initial_health
25
+ end
26
+
27
+ it "blams the player if a low number is rolled" do
28
+ Die.any_instance.stub(:roll).and_return(1)
29
+ @game.play(2)
30
+ @player.health.should == @initial_health - (10 * 2)
31
+ end
32
+
33
+ it "assigns a treasure for points during a player's turn" do
34
+ game = Game.new("Knuckleheads")
35
+ player = Player.new("moe")
36
+
37
+ game.add_player(player)
38
+
39
+ game.play(1)
40
+
41
+ player.points.should_not be_zero
42
+ end
43
+
44
+ it "computes total points as the sum of all player points" do
45
+ game = Game.new("Knuckleheads")
46
+
47
+ player1 = Player.new("moe")
48
+ player2 = Player.new("larry")
49
+
50
+ game.add_player(player1)
51
+ game.add_player(player2)
52
+
53
+ player1.found_treasure(Treasure.new(:hammer, 50))
54
+ player1.found_treasure(Treasure.new(:hammer, 50))
55
+ player2.found_treasure(Treasure.new(:crowbar, 400))
56
+
57
+ game.total_points.should == 500
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,118 @@
1
+ require 'studio_game/player'
2
+ require 'studio_game/treasure_trove'
3
+ require 'csv'
4
+
5
+ module StudioGame
6
+ describe Player do
7
+ before do
8
+ $stdout = StringIO.new
9
+ @initial_health = 150
10
+ @player = Player.new("larry", @initial_health)
11
+ end
12
+
13
+ it "has a capitalized name" do
14
+ @player.name.should == "Larry"
15
+ end
16
+
17
+ it "has an initial health" do
18
+ @player.health.should == @initial_health
19
+ end
20
+
21
+ it "has a string representation" do
22
+ @player.found_treasure(Treasure.new(:hammer, 50))
23
+ @player.found_treasure(Treasure.new(:hammer, 50))
24
+
25
+ @player.to_s.should == "I'm Larry with health = 150, points = 100, and score = 250."
26
+ end
27
+
28
+ it "computes a score as the sum of its health and points" do
29
+ @player.found_treasure(Treasure.new(:hammer, 50))
30
+ @player.found_treasure(Treasure.new(:hammer, 50))
31
+
32
+ @player.score.should == 250
33
+ end
34
+
35
+ it "increases health by 15 when wooted" do
36
+ @player.woot
37
+ @player.health.should == @initial_health + 15
38
+ end
39
+
40
+ it "decreases health by 10 when blammed" do
41
+ @player.blam
42
+ @player.health.should == @initial_health - 10
43
+ end
44
+
45
+ context "with a health greater than 100" do
46
+ before do
47
+ @player = Player.new("larry", 150)
48
+ end
49
+
50
+ it "is strong" do
51
+ @player.should be_strong
52
+ end
53
+ end
54
+
55
+ context "with a health less than 100" do
56
+ before do
57
+ @player = Player.new("larry", 100)
58
+ end
59
+
60
+ it "is wimpy" do
61
+ @player.should_not be_strong
62
+ end
63
+ end
64
+
65
+ context "in a collection of players" do
66
+ before do
67
+ @player1 = Player.new("moe", 100)
68
+ @player2 = Player.new("larry", 200)
69
+ @player3 = Player.new("curly", 300)
70
+
71
+ @players = [@player1, @player2, @player3]
72
+ end
73
+
74
+ it "is sorted by decreasing score" do
75
+ @players.sort.should == [@player3, @player2, @player1]
76
+ end
77
+ end
78
+
79
+ it "computes points as the sum of all treasure points" do
80
+ @player.points.should == 0
81
+
82
+ @player.found_treasure(Treasure.new(:hammer, 50))
83
+
84
+ @player.points.should == 50
85
+
86
+ @player.found_treasure(Treasure.new(:crowbar, 400))
87
+
88
+ @player.points.should == 450
89
+
90
+ @player.found_treasure(Treasure.new(:hammer, 50))
91
+
92
+ @player.points.should == 500
93
+ end
94
+
95
+ it "yields each found treasure and its total points" do
96
+ @player.found_treasure(Treasure.new(:skillet, 100))
97
+ @player.found_treasure(Treasure.new(:skillet, 100))
98
+ @player.found_treasure(Treasure.new(:hammer, 50))
99
+ @player.found_treasure(Treasure.new(:bottle, 5))
100
+ @player.found_treasure(Treasure.new(:bottle, 5))
101
+ @player.found_treasure(Treasure.new(:bottle, 5))
102
+ @player.found_treasure(Treasure.new(:bottle, 5))
103
+ @player.found_treasure(Treasure.new(:bottle, 5))
104
+
105
+ yielded = []
106
+ @player.each_found_treasure do |treasure|
107
+ yielded << treasure
108
+ end
109
+
110
+ yielded.should == [
111
+ Treasure.new(:skillet, 200),
112
+ Treasure.new(:hammer, 50),
113
+ Treasure.new(:bottle, 25)
114
+ ]
115
+ end
116
+
117
+ end
118
+ end
@@ -0,0 +1,57 @@
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
+
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
+ it "returns a random treasure" do
51
+ treasure = TreasureTrove.random
52
+
53
+ TreasureTrove::TREASURES.should include(treasure)
54
+ end
55
+
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rf_2016_studio_game
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Flach
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-05 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
+ studio_game is a command-line game built through instruction by The Pragmatic Studio.
29
+
30
+ Through user input, the game is named and then run through a number of designated rounds.
31
+ Random play is introduced to assign treasure (points) and increase or decrease a player's health.
32
+ At the conclusion of the game (as determined by the user) a .txt file is saved with the high scores.
33
+ email: ryanflach@gmail.com
34
+ executables:
35
+ - studio_game
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - LICENSE
40
+ - README
41
+ - bin/players.csv
42
+ - bin/studio_game
43
+ - lib/studio_game/auditable.rb
44
+ - lib/studio_game/berserk_player.rb
45
+ - lib/studio_game/clumsy_player.rb
46
+ - lib/studio_game/die.rb
47
+ - lib/studio_game/game.rb
48
+ - lib/studio_game/game_turn.rb
49
+ - lib/studio_game/loaded_die.rb
50
+ - lib/studio_game/playable.rb
51
+ - lib/studio_game/player.rb
52
+ - lib/studio_game/treasure_trove.rb
53
+ - spec/studio_game/berserk_player_spec.rb
54
+ - spec/studio_game/clumsy_player_spec.rb
55
+ - spec/studio_game/game_spec.rb
56
+ - spec/studio_game/player_spec.rb
57
+ - spec/studio_game/treasure_trove_spec.rb
58
+ homepage: https://github.com/ryanflach
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.4.6
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Game in which players randomly find treasure
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