Demo entry 6350038

s

   

Submitted by anonymous on Mar 03, 2017 at 01:23
Language: Ruby. Code size: 274 Bytes.

answer = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
guess = gets.to_i
if guess == answer
  p("あたりです!")
  p("おめでとうございます!")
else
  p("はずれ!")
  if guess > answer  # 変数guessは変数answerよりも大きい?
    p("それはちょっと大きすぎるよ!")
  else
    p("それはちょっと小さすぎるよ!")
  end
end
p("また遊んでね!")

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).