Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Counts back by 1 from an inputted number and gives a special message upon further iterations of the loop
- %VARIABLES
- var num : int
- var loopcount : int := 1
- %PROCEDURES
- procedure countBack
- for decreasing i : num .. 1 by 1
- put i, " " ..
- delay (500)
- end for
- end countBack
- %Main loop
- loop
- %Give a special number if the loop has executed more than once
- if loopcount = 1 then
- put "Number to start at: " ..
- get num
- else
- put "Next number to start at: " ..
- get num
- end if
- %Delay to start printing
- delay (250)
- put " "
- %Call procedure
- countBack
- %Housekeeping
- put " "
- put " "
- put "------------"
- put " "
- put " "
- %Increase loopcount
- loopcount += 1
- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement