atelier:mitsuba

i love UI/UX, Blend, XAML, Behavior, P5, oF, Web, Tangible Bits and Physical computing. なにかあればお気軽にご連絡ください。atelier@c-mitsuba.com

Rubyでじゃんけんするプログラムかいたよ。

わけがわからないよ!

puts "じゃんけん!"
begin 
  table = [].push("ぐー").push("ちょき").push("ぱー").each_with_index {|item,i|print i.to_s+":"+item+" "}
  puts "ぽん!\nあなたの手:" + table[hand = gets().to_i] + "\nコンピュータ:" + table[r = rand(table.length)] +"\n"+ [].push("あいこ").push("あなたの負け").push("あなたの勝ち")[j = (hand - r + 3)%3]
end while j != 2

もっと短くして!(てへぺろ