Skip to content

Instantly share code, notes, and snippets.

@daniel-g
Forked from davidxkr/gist:523720
Created August 13, 2010 23:57
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 daniel-g/523745 to your computer and use it in GitHub Desktop.
Save daniel-g/523745 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 no quedo muy claro el problema
# ya que el valor de "d" es el numero triangular correspondiente a 5000
# Por otro lado es posible refactorizar tu codigo de la siguiente manera
d = 0
5001.times do |c|
d += c
end
put "the value number is: #{d}"
# Si tuvieses alguna duda, no dudes en preguntar a cualquier miembro del comité
# Saludos
# Por cierto ... nos debes una caguama y unas Chips Verdes =P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment