#!/usr/bin/ env ruby
# -*- coding: utf-8 -*-
puts"別れ道"
puts"1:左"
puts"2:右"
while true
print"答え入力:"
kotae=gets.chomp.to_i
if kotae==1
puts"敵が現れた"
while true
puts"1:攻撃する"
print"答え入力:"
kotae=gets.chomp.to_i
if kotae==1
puts"倒した"
break
elsif kotae==2
puts"また別れ道だ"
while true
puts"1:真ん中"
puts"2:右"
print"答え入力:"
kotae=gets.chomp.to_i
if kotae==1
puts"地上だ"
puts"終わり"
break
elsif kotae==2
puts"また別れ道"
while true
puts"1:右"
puts"2:真ん中"
puts"3左"
print"答え入力:"
kotae=gets.chomp.to_i
if kotae==1
puts"また別れ道疲れた"
puts"どの道に行こう"
puts"まよう?"
break
elsif kotae==2
puts"もうかきらめる"
break
elsif kotae==3
puts"また別れ道"
break
else
puts"その選択肢はないよ"
redo
end
end
break
end
end
break
end
end
break
end
end