pragmatic_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: f5ce6acdc31ab6b3cd2b967977e261efd4ea09be
4
+ data.tar.gz: 9d31f313dcadb787df45f7522111ec8347bd7ae5
5
+ SHA512:
6
+ metadata.gz: b3400433554db5935b1e3f0a478c01c7ba161483f18f4a554a2ab023ea4bc9e8806d918360f9bd10c7eef88a4fc61ded8bb5ff6c9b005f0874b0453d73ef1b28
7
+ data.tar.gz: 7b0e4901e3cecf6c2ba5a3dba6ab412478de571ebf2eb2ac37b081fdf50208b63f22dc1e1379f47ab24a99b319321d38a92705ae87ff5603fb1ed0921acef6a1
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ Copyright (C) 2014 Takafumi Iwai, Mike and Nicole Clark
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.
8
+
data/README ADDED
@@ -0,0 +1,3 @@
1
+ Studio Game
2
+
3
+ This is an exercise of ruby programming from The Pragmatic Studio's Ruby Course.
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/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
+ knuckleheads.add_player StudioGame::Player.new("moe")
10
+ knuckleheads.add_player StudioGame::Player.new("larry", 60)
11
+ knuckleheads.add_player StudioGame::Player.new("curly", 125)
12
+ knuckleheads.add_player StudioGame::ClumsyPlayer.new("klutz", 105)
13
+ knuckleheads.add_player StudioGame::BerserkPlayer.new("berserker", 50)
14
+
15
+ default_player_file = File.join(File.dirname(__FILE__), "players.csv")
16
+ knuckleheads.load_players(ARGV.shift || default_player_file)
17
+
18
+
19
+ loop do
20
+ puts "\nHow many game round? ('quit' to exit)"
21
+ answers = gets.chomp.downcase
22
+
23
+ case answers
24
+ when /^\d+$/
25
+ knuckleheads.play(answers.to_i)
26
+ when "quit", "exit"
27
+ knuckleheads.print_stats
28
+ break
29
+ else
30
+ puts "Please enter a number of 'quit'"
31
+ end
32
+ end
33
+
34
+ knuckleheads.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,33 @@
1
+ require_relative 'player'
2
+
3
+ module StudioGame
4
+ class BerserkPlayer < Player
5
+ BERSERK_LIMIT = 5
6
+
7
+ def initialize(name, health = 100)
8
+ super(name, health)
9
+ @w00t_count = 0
10
+ end
11
+
12
+ def berserk?
13
+ @w00t_count > BERSERK_LIMIT
14
+ end
15
+
16
+ def blam
17
+ berserk? ? w00t : super
18
+ end
19
+
20
+ def w00t
21
+ super
22
+ @w00t_count += 1
23
+ puts "#{@name} is berserk!" if berserk?
24
+ end
25
+ end
26
+
27
+ if __FILE__ == $0
28
+ berserker = BerserkPlayer.new("berserker", 50)
29
+ 6.times { berserker.w00t }
30
+ 2.times { berserker.blam }
31
+ puts berserker.health
32
+ end
33
+ 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 w00t
13
+ @boost_factor.times { super }
14
+ end
15
+
16
+ def found_treasure(treasure)
17
+ damaged_treasure = Treasure.new(treasure.name, treasure.points / 2.0)
18
+ super(damaged_treasure)
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,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,111 @@
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
12
+ @players = []
13
+ end
14
+
15
+ def add_player(player)
16
+ @players << player
17
+ end
18
+
19
+ def total_points
20
+ @players.reduce(0) { |sum, player| sum + player.points }
21
+ end
22
+
23
+ def load_players(from_file)
24
+ CSV.foreach(from_file) do |row|
25
+ player = Player.new(row[0], row[1].to_i)
26
+ add_player(player)
27
+ end
28
+ end
29
+
30
+ def play(rounds)
31
+ puts "There are #{@players.size} players in #{@title}"
32
+
33
+ treasures = TreasureTrove::TREASURES
34
+ puts "\nThere are #{treasures.size} treasures to be found:"
35
+ treasures.each do |t|
36
+ puts "A #{t.name} is worth #{t.points} points"
37
+ end
38
+
39
+ 1.upto(rounds) do |round|
40
+ if block_given?
41
+ break if yield
42
+ end
43
+
44
+ puts "\nRound #{round}:"
45
+ @players.each do |player|
46
+ GameTurn.take_turn(player)
47
+ end
48
+ end
49
+ end
50
+
51
+ def print_stats
52
+ puts "#{@title} Statistics:"
53
+
54
+ puts strong_and_wimpy_players
55
+ puts treasures
56
+ puts high_scores
57
+ end
58
+
59
+ def save_high_scores(to_file = "high_scores.txt")
60
+ File.open(to_file, "w") do |file|
61
+ file.puts high_scores
62
+ end
63
+ end
64
+
65
+ def strong_and_wimpy_players
66
+ strong, wimpy = @players.partition{ |p| p.strong? }
67
+
68
+ output = "\n#{strong.length} strong players:\n"
69
+ strong.sort.each do |player|
70
+ output << name_and_health(player)
71
+ end
72
+
73
+ output << "\n#{wimpy.length} wimpy players:\n"
74
+ wimpy.sort.each do |player|
75
+ output << name_and_health(player)
76
+ end
77
+
78
+ output
79
+ end
80
+
81
+ def treasures
82
+ output = "\n#{total_points} total points from treasure found\n"
83
+
84
+ @players.sort.each do |player|
85
+ output << "\n #{player.name}'s point totals:\n"
86
+ player.each_found_treasure do |treasure|
87
+ output << " #{treasure.points} total #{treasure.name} points\n"
88
+ end
89
+ output << " #{player.points} total points\n"
90
+ end
91
+
92
+ output
93
+ end
94
+
95
+ def high_scores
96
+ high_scores = "\n#{@title} High Scores:\n"
97
+ @players.sort.each do |player|
98
+ high_scores << name_and_score_like_arcade(player)
99
+ end
100
+ high_scores
101
+ end
102
+
103
+ def name_and_health(player)
104
+ "#{player.name} (#{player.health})\n"
105
+ end
106
+
107
+ def name_and_score_like_arcade(player)
108
+ "#{player.name.ljust(20, '.')} #{player.score}\n"
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,22 @@
1
+ require_relative 'player'
2
+ require_relative 'die'
3
+ require_relative 'loaded_die'
4
+ require_relative 'treasure_trove'
5
+
6
+ module StudioGame
7
+ module GameTurn
8
+ def self.take_turn(player)
9
+ case Die.new.roll
10
+ #case LoadedDie.new.roll
11
+ when 1..2
12
+ player.blam
13
+ when 3..4
14
+ puts "#{player.name} was skipped"
15
+ when 5..6
16
+ player.w00t
17
+ end
18
+
19
+ player.found_treasure(TreasureTrove.random)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ require_relative 'auditable'
2
+
3
+ module StudioGame
4
+ class LoadedDie
5
+ include Auditable
6
+
7
+ attr_reader :number
8
+
9
+ def roll
10
+ numbers = [1, 1, 2, 5, 6, 6]
11
+ @number = numbers.sample
12
+ audit
13
+ @number
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ module StudioGame
2
+ module Playable
3
+ def strong?
4
+ self.health > 100
5
+ end
6
+
7
+ def blam
8
+ self.health -= 10
9
+ puts "#{self.name} got blammed!"
10
+ end
11
+
12
+ def w00t
13
+ self.health += 15
14
+ puts "#{self.name} got w00ted!"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,68 @@
1
+ require_relative 'playable'
2
+ require_relative 'treasure_trove'
3
+
4
+ module StudioGame
5
+ class Player
6
+ include Playable
7
+
8
+ attr_reader :name
9
+ attr_accessor :health
10
+
11
+ # constractor
12
+ def initialize(name, health = 100)
13
+ @name = name.capitalize
14
+ @health = health
15
+ @found_treasure = Hash.new(0)
16
+ end
17
+
18
+ def self.from_csv(line)
19
+ name, health = line.split(",")
20
+ Player.new(name, Integer(health))
21
+ end
22
+
23
+ # setter
24
+ def name=(new_name)
25
+ @name = new_name.capitalize
26
+ end
27
+
28
+ def to_s
29
+ "I'm #{@name} with a health = #{@health}, points = #{points}, and score = #{score}"
30
+ end
31
+
32
+ def score
33
+ @health + points
34
+ end
35
+
36
+ def points
37
+ @found_treasure.values.reduce(0, :+)
38
+ end
39
+
40
+ # custom iterator
41
+ def each_found_treasure
42
+ @found_treasure.each do |name, points|
43
+ yield Treasure.new(name, points)
44
+ end
45
+ end
46
+
47
+ # comparison
48
+ def <=>(other)
49
+ other.score <=> score
50
+ end
51
+
52
+ def found_treasure(treasure)
53
+ @found_treasure[treasure.name] += treasure.points
54
+ puts "#{@name} found a #{treasure.name} worth #{treasure.points} points"
55
+ puts "#{@name}'s treasure: #{@found_treasure}"
56
+ end
57
+ end
58
+ end
59
+
60
+ if __FILE__ == $0
61
+ player = Player.new("moe")
62
+ puts player.name
63
+ puts player.health
64
+ player.w00t
65
+ puts player.health
66
+ player.blam
67
+ puts player.health
68
+ 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,32 @@
1
+ require 'studio_game/berserk_player'
2
+
3
+ module StudioGame
4
+
5
+ describe BerserkPlayer do
6
+
7
+ before do
8
+ $stdout = StringIO.new
9
+ @initial_health = 50
10
+ @player = BerserkPlayer.new("berserker", @initial_health)
11
+ end
12
+
13
+ it "does not go berserk when w00ted up to 5 times" do
14
+ 5.times { @player.w00t }
15
+
16
+ @player.should_not be_berserk
17
+ end
18
+
19
+ it "goes berserk when w00ted more than 5 times" do
20
+ 6.times { @player.w00t }
21
+
22
+ @player.should be_berserk
23
+ end
24
+
25
+ it "gets w00ted instead of blammed when it's gone berserk" do
26
+ 6.times { @player.w00t }
27
+ 2.times { @player.blam }
28
+
29
+ @player.health.should == @initial_health + (15 * 8)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,47 @@
1
+ require 'studio_game/clumsy_player'
2
+
3
+ module StudioGame
4
+
5
+ describe ClumsyPlayer do
6
+ before do
7
+ $stdout = StringIO.new
8
+ @initial_health = 100
9
+ @boost_factor = 5
10
+ @player = ClumsyPlayer.new("klutz", @initial_health, @boost_factor)
11
+ end
12
+
13
+ it "only gets half the point value for each treasure" 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 "has a boost factor" do
37
+ @player.boost_factor.should == 5
38
+ end
39
+
40
+ it "gets boost factor number of w00ts when w00ted" do
41
+ @player.w00t
42
+
43
+ @player.health.should == @initial_health + (15 * @boost_factor)
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,73 @@
1
+ require 'studio_game/game'
2
+
3
+ module StudioGame
4
+ describe Game do
5
+ context "with no setup" do
6
+ before do
7
+ end
8
+
9
+ it "computes total points as the sum of all player points" do
10
+ game = Game.new("Knuckleheads")
11
+
12
+ player1 = Player.new("moe")
13
+ player2 = Player.new("larry")
14
+
15
+ game.add_player(player1)
16
+ game.add_player(player2)
17
+
18
+ player1.found_treasure(Treasure.new(:hammer, 50))
19
+ player1.found_treasure(Treasure.new(:hammer, 50))
20
+ player2.found_treasure(Treasure.new(:crowbar, 400))
21
+
22
+ game.total_points.should == 500
23
+ end
24
+ end
25
+
26
+ context "with a basic setup" do
27
+ before do
28
+ @game = Game.new("Knuckleheads")
29
+
30
+ @initial_health = 100
31
+ @player = Player.new("moe", @initial_health)
32
+
33
+ @game.add_player(@player)
34
+
35
+ $stdout = StringIO.new
36
+ end
37
+
38
+ it "w00ts the player if a high number is rolled" do
39
+ Die.any_instance.stub(:roll).and_return(5)
40
+
41
+ @game.play(2)
42
+
43
+ @player.health.should == (@initial_health + 15 * 2)
44
+ end
45
+
46
+ it "skip the player if a medium number if rolled" do
47
+ Die.any_instance.stub(:roll).and_return(3)
48
+
49
+ @game.play(2)
50
+
51
+ @player.health.should == @initial_health
52
+ end
53
+
54
+ it "blams the player if a low number if rolled" do
55
+ Die.any_instance.stub(:roll).and_return(1)
56
+
57
+ @game.play(2)
58
+
59
+ @player.health.should == (@initial_health - 10 * 2)
60
+ end
61
+
62
+ it "assigns a treasure for points during a player's turn" do
63
+ game = Game.new("Knuckleheads")
64
+ player = Player.new("moe")
65
+
66
+ game.add_player(player)
67
+ game.play(1)
68
+
69
+ player.points.should_not be_zero
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,123 @@
1
+ require 'studio_game/player'
2
+
3
+ module StudioGame
4
+ describe Player do
5
+
6
+ before do
7
+ @initial_health = 150
8
+ @player = Player.new("larry", 150)
9
+ $stdout = StringIO.new
10
+ end
11
+
12
+ it "has a capitalized name" do
13
+ @player.name.should == 'Larry'
14
+ end
15
+
16
+ it "has an initial health" do
17
+ @player.health.should == 150
18
+ end
19
+
20
+ it "can be created from a CSV string" do
21
+ player = Player.from_csv("larry,150")
22
+
23
+ player.name.should == "Larry"
24
+ player.health.should == 150
25
+ end
26
+
27
+ context "with 2 hammers" do
28
+ before do
29
+ @player.found_treasure(Treasure.new(:hammer, 50))
30
+ @player.found_treasure(Treasure.new(:hammer, 50))
31
+ end
32
+
33
+ it "computes a score as the sum of its health and points" do
34
+ @player.score.should == 250
35
+ end
36
+
37
+ it "has a string representation" do
38
+ @player.to_s.should == "I'm Larry with a health = 150, points = 100, and score = 250"
39
+ end
40
+ end
41
+
42
+ it "increases health by 15 when w00ted" do
43
+ @player.w00t
44
+
45
+ @player.health.should == (@initial_health + 15)
46
+ end
47
+
48
+ it "decreases health by 10 when blammed" do
49
+ @player.blam
50
+
51
+ @player.health.should == (@initial_health - 10)
52
+ end
53
+
54
+ it "computes points as the sum of all treasure points" do
55
+ @player.points.should == 0
56
+
57
+ @player.found_treasure(Treasure.new(:hammer, 50))
58
+ @player.points.should == 50
59
+
60
+ @player.found_treasure(Treasure.new(:crowbar, 400))
61
+ @player.points.should == 450
62
+
63
+ @player.found_treasure(Treasure.new(:hammer, 50))
64
+ @player.points.should == 500
65
+ end
66
+
67
+ it "yields each found treasure and its total points" do
68
+ @player.found_treasure(Treasure.new(:skillet, 100))
69
+ @player.found_treasure(Treasure.new(:skillet, 100))
70
+ @player.found_treasure(Treasure.new(:hammer, 50))
71
+ @player.found_treasure(Treasure.new(:bottle, 5))
72
+ @player.found_treasure(Treasure.new(:bottle, 5))
73
+ @player.found_treasure(Treasure.new(:bottle, 5))
74
+ @player.found_treasure(Treasure.new(:bottle, 5))
75
+ @player.found_treasure(Treasure.new(:bottle, 5))
76
+
77
+ yielded = []
78
+ @player.each_found_treasure do |treasure|
79
+ yielded << treasure
80
+ end
81
+
82
+ yielded.should == [
83
+ Treasure.new(:skillet, 200),
84
+ Treasure.new(:hammer, 50),
85
+ Treasure.new(:bottle, 25)
86
+ ]
87
+ end
88
+
89
+ context "with a health greater than 100" do
90
+ before do
91
+ @player = Player.new("larry", 150)
92
+ end
93
+
94
+ it "is strong" do
95
+ @player.should be_strong
96
+ end
97
+ end
98
+
99
+ context "with a health of 100 or less" do
100
+ before do
101
+ @player = Player.new("larry", 100)
102
+ end
103
+
104
+ it "is wimpy" do
105
+ @player.should_not be_strong
106
+ end
107
+ end
108
+
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,53 @@
1
+ require 'studio_game/treasure_trove'
2
+
3
+ module StudioGame
4
+ describe Treasure do
5
+ before do
6
+ @treasure = Treasure.new(:hammer, 50)
7
+ end
8
+
9
+ it "has a name attribute" do
10
+ @treasure.name.should == :hammer
11
+ end
12
+
13
+ it "has a points attribute" do
14
+ @treasure.points.should == 50
15
+ end
16
+ end
17
+
18
+ describe TreasureTrove do
19
+ it "has six treasures" do
20
+ TreasureTrove::TREASURES.size.should == 6
21
+ end
22
+
23
+ it "has a pie worth 5 points" do
24
+ TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
25
+ end
26
+
27
+ it "has a bottle worth 25 points" do
28
+ TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
29
+ end
30
+
31
+ it "has a hammer worth 50 points" do
32
+ TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
33
+ end
34
+
35
+ it "has a skillet worth 100 points" do
36
+ TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
37
+ end
38
+
39
+ it "has a broomstick worth 200 points" do
40
+ TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
41
+ end
42
+
43
+ it "has a crowbar worth 400 points" do
44
+ TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
45
+ end
46
+
47
+ it "returns a random treasure" do
48
+ treasure = TreasureTrove.random
49
+
50
+ TreasureTrove::TREASURES.should include(treasure)
51
+ end
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pragmatic_studio_game
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Takafumi Iwai
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-14 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
29
+
30
+ This is an exercise of ruby programming from The Pragmatic Studio's Ruby Course.
31
+ email: takafumi@tawashi.org
32
+ executables:
33
+ - studio_game
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - LICENSE
38
+ - README
39
+ - bin/players.csv
40
+ - bin/studio_game
41
+ - lib/studio_game/auditable.rb
42
+ - lib/studio_game/berserk_player.rb
43
+ - lib/studio_game/clumsy_player.rb
44
+ - lib/studio_game/die.rb
45
+ - lib/studio_game/game.rb
46
+ - lib/studio_game/game_turn.rb
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
+ homepage: http://pragmaticstudio.com/
57
+ licenses: []
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '1.9'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 2.2.1
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Exercise created in Pramatic Studio's Ruby course
79
+ test_files:
80
+ - spec/studio_game/berserk_player_spec.rb
81
+ - spec/studio_game/clumsy_player_spec.rb
82
+ - spec/studio_game/game_spec.rb
83
+ - spec/studio_game/player_spec.rb
84
+ - spec/studio_game/treasure_trove_spec.rb