R
Rawn
How can I do it? Sorry if this is stupid or something but I'm just
learning to program (starting with ruby) and this seemed like a more
interesting way to start than endless arithmatic operations..
#!/usr/bin/ruby
Inventory = Array.new
Discovered = Array.new
Victory = 0
puts "You are in a dim room. You can just make out a door by the light
shining through the cracks."
while Victory < 1
inputcommand = gets.chomp!
if inputcommand = "search"
Victory + 1 == Victory
end
end
I'd like to change the value of Victory to 1 when "search" is typed
into the prompt, thus causing the while loop to end, ending the
script. This may be the completly wrong way to go about doing this but
atleast tell me how to do what I want before you school me in the
proper way of doing things ; )
thanks in advance
learning to program (starting with ruby) and this seemed like a more
interesting way to start than endless arithmatic operations..
#!/usr/bin/ruby
Inventory = Array.new
Discovered = Array.new
Victory = 0
puts "You are in a dim room. You can just make out a door by the light
shining through the cracks."
while Victory < 1
inputcommand = gets.chomp!
if inputcommand = "search"
Victory + 1 == Victory
end
end
I'd like to change the value of Victory to 1 when "search" is typed
into the prompt, thus causing the while loop to end, ending the
script. This may be the completly wrong way to go about doing this but
atleast tell me how to do what I want before you school me in the
proper way of doing things ; )
thanks in advance