Skip to content

Instantly share code, notes, and snippets.

@davidxkr
Created August 13, 2010 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidxkr/523720 to your computer and use it in GitHub Desktop.
Save davidxkr/523720 to your computer and use it in GitHub Desktop.
#Feedback from "El gran pregunton" !!!!
c = 0
d = 0
5001.times do
c += 1
d = d + c
end
put "the value number is: #{d}"
# Al parecer que no te quedo claro el problema
# ya que el valor de "d" es el numero triangular correspondiente a 5000
# Por otro lado podemos refactorizar tu codigo de la siguiente forma
d = 0
5001.times do |c|
d += c
end
put "the value number is: #{d}"
#Recuerda si realmente quieres aprender rails, primero debes de aprender ruby
#Puedes preguntar a cualquier miembro del comite estamos para ayudarte a mejorar
#Saludos
#Por cierto Me debes una caguama y unas Chips Verdes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment