Skip to content

Instantly share code, notes, and snippets.

Created April 14, 2012 09:18
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 anonymous/2383076 to your computer and use it in GitHub Desktop.
Save anonymous/2383076 to your computer and use it in GitHub Desktop.
def prompt
print ">> "
end
puts "Od ilu zaczynamy?"
prompt
i = STDIN.gets()
numbers = []
if i == 0
numbers = []
else
for n in(0..i)
numbers.push(n)
end
end
puts "Na ilu konczymy?"
prompt
dziupla = STDIN.gets()
def bob(i, numbers, dziupla)
while i <= dziupla
puts "At the top i is #{i}"
numbers.push(i)
i = i + 1
puts "Numbers now: #{numbers}"
puts "At the bottom i is #{i}}"
end
end
bob(i, numbers, dziupla)
puts "The numbers"
for num in numbers
puts num
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment