Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

A little about what school “computer science” was like in the 90s, and why all programmers then were exclusively self-taught.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

How children were taught to program

In the early 90s, Moscow schools began to be selectively equipped with computer classes. In the premises, bars were immediately placed on the windows and a heavy iron-studded door. A computer science teacher appeared from somewhere (he looked like the most important friend after the director), whose main task was to make sure that no one touched anything. Nothing at all. Even the front door.
In the classrooms, it was most often possible to meet the BK-0010 (in its varieties) and BK-0011M systems.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it
Photo taken hence

The children were told about the general device, as well as about a dozen Basic commands so that they could draw lines and circles on the screen. For junior and middle classes, this was probably enough.

With the preservation of their creations (programs) then there were separate problems. Most often, computers with the help of monochannel controllers were networked with a "common bus" topology and a transmission rate of 57600 baud. The drive, as a rule, was one, and it often did not go well with it. Either it works, or it doesn’t work, then the network hangs, then the floppy disk is not readable.

I then dragged with me this creation with a capacity of 360 kB.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

The chances that once again I will pull out my program from her were 50-70 percent.

However, the main problem of all these stories with BK computers was endless freezes.

This could happen at any time, whether it was typing code or executing a program. A hung system meant that you spent 45 minutes of your time in vain, because. I had to do everything all over again, but the remaining time of the lesson was no longer enough for this.

Closer to 1993, in some schools and lyceums, normal classes appeared with 286 cars, and in some places there were even "three rubles". In terms of programming languages, there were two options: where BASIC ended, Turbo Pascal began.

Programming in "Turbo Pascal" on the example of "tanks"

On Pascal, children were taught to build cycles, draw all sorts of functions, and work with arrays. In the Physics and Mathematics Lyceum, where I “dwelled” at one time, one couple a week was assigned to computer science. And for two years there was this boring thing. Of course, I wanted to do something more serious than displaying the values ​​of an array or a certain sinusoid on the screen.

tanks

Battle City was one of the most popular NES clone console games (Dendy and others).

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

In 1996, the popularity of 8-bits passed, they had long been collecting dust in the cabinets, and it seemed cool to me to make a clone of Tanks for PC as something large-scale. Further, just about how then it was necessary to dodge in order to file something with graphics, a mouse and sound on Pascal.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

You can only draw sticks and circles

Let's start with graphics.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

In the basic version, "Pascal" allowed you to draw some shapes, paint over and determine the colors of points. The most advanced procedures in the Graph module that bring us closer to sprites are GetImage and PutImage. With their help, it was possible to capture a section of the screen into a previously reserved memory area and then use this piece as a bitmap. In other words, if you want to reuse some elements or images on the screen, you first draw them, copy them to memory, erase the screen, draw the next one, and so on until you create the desired library in memory. Since everything happens quickly, the user does not notice these tricks.

The first module where sprites were used was the map editor.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

It had a marked playing field. A mouse click brought up a menu where you could choose one of four obstacle options. Speaking of mice...

The mouse is already the end of the 90s

Everyone had mice, of course, but until the mid-90s, they were used only in Windows 3.11, graphics packages, and a small number of games. In Wolf and Doom, they were cut only from the keyboard. And in a DOS environment, the mouse was not really needed. Therefore, in Borland, the mouse module was not even included in the standard delivery. He had to be searched for by acquaintances who shrugged and exclaimed in response, “What for is he to you?”.

However, finding a mouse polling module is only half the battle. To click on the on-screen buttons with the mouse, they had to be drawn. And in two versions (pressed and not pressed). The unpressed button has a light top, and a shadow below it. Pressed is the opposite. And then draw on the screen three times (not pressed, pressed, then again not pressed). Plus, do not forget to put delays on the display, well, hide the cursor.

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

For example, the processing of the main menu in the code looked like this:

Tanks in Pascal: how children were taught programming in the 90s and what was wrong with it

Sound - PC Speaker beeper only

A separate story with sound. In the early nineties, the Sound Blaster clones were just getting ready for their triumphant march, and most applications only worked with the built-in speaker. The maximum of its capabilities is the simultaneous reproduction of only one tone. And that's exactly what Turbo Pascal did. Through the sound procedure, it was possible to “beep” with different frequencies, which is enough for the sounds of shots and explosions, but for a musical screen saver, as it was fashionable then, this was not suitable. As a result, a very tricky solution was found: in the software’s own archive, an “executable” was found that was once downloaded from some BBS. He knew how to work miracles - to play uncompressed wav-s through the PC Speaker, and he did it from the command line and did not have an actual interface. All that was needed was to call it through the Pascal exec procedure and make sure that this construction did not collapse.

As a result, the downhole Mouzon appeared on the screensaver, but a funny thing came out with it. In 1996, I had a system on a Pentium 75, upgraded to 90. Everything worked fine on it. At the university, where we were given Pascal for the second semester, there were well-worn three-ruble notes in the classroom. By agreement with the teacher, I dragged these tanks to the second lesson in order to get credit and not go there anymore. And so, after launching, a loud roar came out of the speaker, mixed with gurgling guttural sounds. In general, the 33-MHz “three-ruble note” DX turned out to be unable to rotate the same “executive” normally. But otherwise everything was fine. Of course, not counting the sluggish keyboard polling, which spoiled the entire gameplay, regardless of PC performance.

But the main problem is not in "Pascal"

In my understanding, “Tanks” is the maximum that could be squeezed out of Turbo Pascal without assembler inserts. Of the obvious shortcomings of the final product - slow keyboard polling and slow graphics rendering. The situation was aggravated by an extremely small number of third-party libraries and modules. They could be counted on the fingers of one hand.

But most of all I was upset by the approach in school education. No one then told children about the advantages and possibilities of other languages. In the classroom, almost immediately they began to talk about begin, println and if, which locked students inside the BASIC-Pascal paradigm. Both of these languages ​​can be considered exclusively educational. Their "combat" use is a rare occurrence.

Why teach children fake languages ​​is a mystery to me. Let them be more visible. Let the BASIC varieties be used here and there. But, in any case, if a person decides to connect his future with programming, he will have to learn other languages ​​from scratch. So why don't children set the same educational tasks, but only on a normal platform (language), within which they could develop further on their own?

Speaking of tasks. At school and institute, they have always been abstract: calculate something, build a function, draw something. I studied at three different schools, plus we had "Pascal" in the first year of the institute, and not once did the teachers set any real applied problem. For example, make a notebook or something else useful. Everything was contrived. And when a person solves empty problems for months, which then go to the basket ... In general, people already leave the institute burnt out.

By the way, in the third year of the same university, we were given “pluses” in the program. It seems like a good thing, but the people were tired, fed up with fakes and "educational" tasks. Enthusiasm, as for the first time, no one was observed.

PS I googled on the topic of what languages ​​are now taught in schools in computer science classes. Everything is the same as 25 years ago: Basic, Pascal. Single inclusions are Python.

Source: habr.com

Add a comment