a=[] while (g=gets)!=nil do a.push(g.chomp.partition(/ +/)) end c=["digi","petit","rabi","gema","piyo"] norm=[/[nN][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[nN][yY][uU][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[a-zA-Z0-9]+/,/[gG][eE][mM][aA][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[pO][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/] a.length.times do |i| cr=a[i][0] st=a[i][2] j=0 while j=c.length puts "WRONG!" next end if st=~norm[j] puts "CORRECT (maybe)" else puts "WRONG!" end end