Module: DemigodGame

Defined in:
lib/demigodGame.rb,
lib/demigodGame/version.rb

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.newObject



7
8
9
10
11
12
13
14
# File 'lib/demigodGame.rb', line 7

def self.new
  puts UiHandler::NEW_GAME
  until (size = gets.chomp).match(/^\d+$/) && size.to_i >= 3
    puts "Invalid world size"
  end

  @demigod = Demigod.new(World.new(size.to_i))
end

.runObject



16
17
18
19
20
# File 'lib/demigodGame.rb', line 16

def self.run
  while true
    @demigod.turn
  end
end