Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Loops infinetly and announces loop repetition number when user types 'more'
- %VARIABLES
- var loopcount : int := 1
- var input : string
- %Main Loop
- loop
- put "Loop execution #", loopcount
- delay (250)
- put "Type 'more' to continue, type 'exit' to exit"
- get input
- if input = "more" then %Restart loop when user types "more"
- delay (500)
- elsif input = "exit" then %End loop when user types "Exit"
- exit
- else %Give a message when the user doesnt give a set response
- put "command not recognised"
- loopcount:= 0
- put " "
- end if
- loopcount += 1
- put " "
- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement