In high school, the school opened a computer class. At that time, the computer is a relatively rare thing, the school computer in total more than 10 units, but also specifically found a hall to display these machines. The hall was covered with thick carpets, all day long with heavy curtains. Every day before class, we need to bathe, and cut our nails. In class, we all wear shoes cover, line up the team, lined up into the engine room. Then the students sit in their seats, under the teacher's command, take out a five-inch floppy disk, with a DOS operating system installed on the diskette, and plug into the computer's a drive. Then turn on the monitor, the host power supply, in a squeak, waiting for the computer to start, into a magical world full of fantasy.
It was at that time that I wrote the first line of procedures. At that time we learned a language called Gwbasic, which is a branch of the basic language.
Basic is a very simple interactive programming language. The coder needs to compile a line number for each line of code. Line number is a natural number, in order to debug the needs of the future, generally in the initial preparation of line number deliberately leave a surplus, not in accordance with 1, 2, 3 ... The way to prepare line number, but in accordance with 10, 20, 30 ... The form. After the program is entered, run the "Run" command, and the compiler interprets the execution procedure in the order of the line number.
This way of programming is too simple, as long as you remember a few process control, input and output keywords, you can write a simple program. That period of time every day I think of the things I encountered in the program written out, multivariate multiple equations, guessing the number of games, trigonometric function curve ... First, the idea of programming in the paper, every week in class and then write on the computer, debugging and running. The debugging method is also very simple, is to print the value to the screen, and then run the view results. When you're finished, run the Save command and save the code to a floppy disk.
The middle school period should be a person's thinking the most flexible period, the later period of experience gradually rich, but the ability to learn new knowledge is actually in decline. Unless it is specially developed, many aspects of knowledge remain at the secondary level. For example, for a professional computer professionals, his history, language, physics, chemistry knowledge is likely to stay in the middle school forever level. That time I crazy write program, the biggest wish is to have a computer at home, install Gwbasic compiler, I can shut myself in the room every day, with Gwbasic write Super Mary, or tank war the same game.
Gwbasic uses a very primitive way to process Control--goto. He also has the concept of a function, but in fact it is also goto to a piece of code (using the GoSub instruction), and then Goto back (using return instructions). According to prevailing ideas at the time, the use of Goto in the program is not improper, which is a normal way to achieve the condition loop. For example, the following code:
Let I = 0
i = i + 2
PRINT I
-IF I < THEN GOTO 60
Here is a piece of code I wrote at that time, this is a game of guessing numbers, he is in Goto Goto go to the circle, like to enter a maze. Luckily, the maze was small enough to find out what he was doing. The code was saved to the present because he didn't keep it in a floppy disk like any other code, but instead recorded it in the margin of the book.
PRINT "Guess A number"
INPUT A
IF A > 5 THEN GOTO 60
IF A < 5 THEN GOTO 80
IF A = 5 THEN GOTO 100
PRINT "Too Big"
20 GOTO
PRINT "Too Small"
20 GOTO
PRINT "Right"
The end