Created
April 14, 2012 06:48
-
-
Save lfborjas/2382515 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#la solución | |
def es_palindromo?(str) | |
return str == str.reverse | |
end | |
#pruebas | |
pruebas = ["anita lava la tina", "fantasma escritor"] | |
pruebas.each do |prueba| | |
puts "#{prueba} es palíndromo" if es_palindromo?(prueba) | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop do | |
print "RPN> " | |
rpn_expr = gets.chomp | |
#alguna condición para salir? PORQUE ESTE LOOP ES INFINITO! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment