Module: Cricket::Game

Defined in:
lib/cricket/game.rb

Class Method Summary collapse

Class Method Details

.playerScore(player, gameType) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cricket/game.rb', line 6

def self.playerScore(player, gameType)
	gameType = gameType.capitalize
	case gameType
	when "Test"
		balls = rand(0..400)
		player.playTest(balls)
	when "Odi"
		balls = rand(0..175)
		player.playODI(balls)
	when "T20"
		balls = rand(0..75)
		player.playT20(balls)
	else
		puts "Wrong GameType"
	end
end