I remember, when I was very young, typing the following program into my very basic computer
10 Print " Hello"
20 Goto 10
which meant that as the computer read line 10, it printed Hello on the screen. The computer then read line 20 which told it to go back to 10 and therefore printed "Hello" again and repeated this all the way down the screen until I made it stop. This is a very simple form of "looping".
No comments:
Post a Comment