Created
April 14, 2012 09:18
-
-
Save anonymous/2383076 to your computer and use it in GitHub Desktop.
This file contains 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
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