Sha256: d4be801a83e8bd8450f5f764b2315f65b436b6716af29ac1b79a42b6f6c2f208

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/studio_game/player'
require_relative '../lib/studio_game/game'
require_relative '../lib/studio_game/clumsy_player'
require_relative '../lib/studio_game/berserk_player'

knuckleheads = StudioGame::Game.new("Knuckleheads")
players_file = File.join(File.dirname(__FILE__), 'players.csv')
knuckleheads.load_players(ARGV.shift || players_file)

klutz = StudioGame::ClumsyPlayer.new('klutz', 105)
knuckleheads.add_player(klutz)

berserk = StudioGame::BerserkPlayer.new('berserk', 50)
knuckleheads.add_player(berserk)

loop do
	puts "\nHow many game rounds? ('quit' to exit)"

	answer = gets.chomp.downcase

	case answer
	when /^\d+$/
		knuckleheads.play(Integer(answer))
	when 'quit', 'exit'
		knuckleheads.print_stats
		break
	else
		puts "Please enter a number or 'quit'"
	end

end
knuckleheads.save_high_scores

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
studio_game_20150214-1.0.0 bin/studio_game