#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
while true
  puts("今年の干支は?")
  z=1
  eto=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
  while z<13
    printf("%d.%s ",z,eto[z-1])
    z+=1
  end
  puts("")
  ans=gets.chomp.to_i
  if ans==5
    puts("正解!今年は辰年です。")
    break
  elsif ans>=13
    puts("12以下の整数で答えてね")
    redo
  else
    puts("残念…違います…")
    redo
  end
end
