From: Bruno Santana Date: 2010-04-13T09:00:17+09:00 Subject: Re: My application doesn't work well I'm not so good in English but I understood that I shoud show you my whole code. I put a different if like what the guy above suggested and I worked. Thanks: class Jogo def sorteia opcoes = ['pedra','papel','tesoura'] numero = 1 + rand(3) return numero end def joga(usuario) result = sorteia() resultSorteio = result.to_i puts(resultSorteio) if resultSorteio == 1 then maquina = "pedra" elsif resultSorteio == 2 then maquina = "papel" else maquina = "tesoura" end puts(maquina) puts(usuario) usuario.chop if usuario == maquina then puts("empatou") else puts("alguem ganhou") end end end j = Jogo.new() print "Digite pedra, papel ou tesoura: " opcaoUsuario = gets() j.joga(opcaoUsuario) -- Posted via http://www.ruby-forum.com/.