Advertisement
Mesaif

TURING - CH4Ex3

May 11th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. %Tells how many words were entered once the keyword 'end' has been typed
  2. %VARIABLES
  3. var words : int := 1
  4. var Cword : string
  5.  
  6.  
  7. %Main loop
  8. loop
  9. for num : 1 .. words
  10. put words, ":" ..
  11. get Cword
  12. if Cword = "end" then
  13. put words, " words entered until signal word" %Restart loop when "end" is typed"
  14. words := 1
  15. put "----------------------------"
  16. put " "
  17. put " "
  18. delay (500)
  19.  
  20. end if
  21.  
  22. words += 1 %Reset words count
  23. exit when Cword = "end" %exit loop when "end" is typed
  24. end for
  25.  
  26.  
  27. delay (250) %Cleaning up to restart loop
  28.  
  29.  
  30.  
  31. end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement