Writing a Tetris clone in GW-BASIC -- Tandy 1000 programming example

preview_player
Показать описание
In this tool-assisted education video I demonstrate how to create a Tetris clone in GW-BASIC, a programming language tool written by Microsoft. You see me type every line.

Microsoft GW-BASIC and Basica are the predecessors to QBasic, which was a popular programming tool shipped without extra charge with MS-DOS versions 4 through 5.
In those days, it was de-facto standard to provide a computer with a BASIC interpreter. Those days are no longer, but in my opinion, even today, BASIC remains one of the easiest platforms to start programming something visual.

In this video, I also demonstrate the multi-channel PC speaker of Tandy 1000 to play some music tunes.

The source code (and the script I used for reference when creating this video) can be found at:
You can download this video in HD (better HD than Youtube's, and A/V sync fixed) at:

The syntax highlighting in the video is generated by a TSR that I launch in the beginning of the video. It scans and recolors the VRAM continually. I created that tool for the making of this video.

Note: The audio in this video is slightly badly timed. It is difficult to sync those properly in Youtube when you use nonstandard FPS. Apologies. At least I tried.

The whole video series:
Рекомендации по теме
Комментарии
Автор

My secret is in being fascinated to learn how things work, and in achieving pleasure from being able to make changes and/or to create something new.
In other words, inspiration. Programming is a motivation driven pursuit.
From my own experience I know that you can transform from knowing nothing about programming into being able to make simple games in less than a year, if even a small success can motivate you. I cannot teach motivation. I can teach basics, but there are plenty of other tutorials.

Bisqwit
Автор

@uilium It really is, in fact, GW-BASIC. However, I installed a custom syntax highlighter to make the video slightly more interesting to watch (and for me more fun to program).
For comparison, you can see QBasic in my other videos, such as this snake game at TUa5HJUebEA . QBasic is quickly identified by its ever-persistent "File Edit View .." menu bar at the top of the screen. GW-BASIC's user interface is quite different.

Bisqwit
Автор

The source code can be found by reading the video description.
You will have to enter the source code in the BASIC interpreter to be able to run it.
Alternatively, you can download the floppy image and boot using it to try it out.

Bisqwit
Автор

I felt so nostalgic!!! But I can't do something like this, nor even before, especially now! You are great!

RicardoAmaralAndrade
Автор

My favourite part of this video: The syntax highlighting. It's like magic. Oddly fascinating a challenge. Oh, if it were available in the 80s (for the popular tool that was GW-BASIC), it would have driven people crazy in the ecstatic programming experience.

Bisqwit
Автор

@Waqarj2 It is for GW-BASIC. It almost works in QBasic too. QBasic does not allow redefining FN-functions. After changing them, it works in QBasic too.

Bisqwit
Автор

wish I could do this. i started with gwbasic and somehow it's more fun than whatever I'm doing now

henrikgustav
Автор

@calledenoche Do you get it before gameover or after gameover? Did you type the code yourself by repeating from video, or did you download one of the versions I made available? Which version? Note that I made some typos while entering this program (which I do fix during the video). Do not repeat the typos. Also it is possible that you mistyped one of the data lines at 31 or 41.
Make sure your code matches my listing, you can download it if you read the video information.

Bisqwit
Автор

Great work. Lots of nostalgia :) You could have sold that syntax highlighting TSR back in the day!

GloriousCow
Автор

A true artist is not defined by their tools, mr. troll.

Bisqwit
Автор

@TheTiktok999 You can playback the video on your laptop then.

It does not do you good, for you to download the GW-BASIC program I wrote, because to them, it's just a tetris clone, a game. Your peers probably possess one or more variants themselves. The performance is in typing the code and understanding how it accomplishes what it does. Do you want to do that? Then get started.

Bisqwit
Автор

@ElliotLakeCanada No. for starts, GWBASIC does not have network support whatsoever, and it has severe memory constraints. About converting to EXE, it is a "no and yes" situation. with QuickBASIC, you can compile them to EXEs (sometimes you'll have to modify the code first), but those EXE files are for DOS only. Meaning, they don't work on 64-bit Windows, and even on 32-bit Windows it works like a truck in a mall. But once you know what it _can_ be used for, it's a fun tool and for learning too.

Bisqwit
Автор

man I could've used that BASIC syntax colorizer app decades ago!
nice video - really brings back good memories of my old Tandy PC

erikhicks
Автор

Does it have a serial port? If it does, you might use a null modem cable. It may really require some hackery to transfer data to such an old computer. I recently faced a similar problem with Tandy 1000, though I was fortunate enough to have a spare 5.25 inch floppy drive that got things rolling. I also learned that real Tandy 1000's display memory is a LOT slower than it is on DOSBox.

Bisqwit
Автор

For playback, I created my own. You can find it in Google-search for "bisqwit text inputter".
For the other part, the tools are different and varied, subject to customization on every video, and I do not publish them.

Bisqwit
Автор

Yes, it is a Tandy-special edition. The regular IBM PC descendants do not have the necessary hardware for it.

Bisqwit
Автор

I have basically rewrote this entire game in BBC Basic for windows using your video...I have opted not to use goto statements. I instead used function calls for all the code, but had to use it in the collision test function as Basic does not have a "break" statement like in c++ and "higher" languages...I hope to port this code over to c++ with a modern object oriented design, but for now i have a working game of tetris with i fought is quite an achievement! If anyone is interested i might upload it to my channel. I will credit Bisqwit for the original of course.

acatisfinetoo
Автор

Ahem. Did this in 1992, no syntax highlighter, 50 lines. Just look up my full name and Tetris.


AtheistWren
Автор

This is incredible. I bet you needed a lot of patience to do it...

TheJFGB
Автор

hey that is Qbasic not GW I programed a lot of weird stuff on an Tandy TV computer when I was a teen. I developed a little artificial intelligence in a program that made a random D&D dungeon. and all withe a intermediate knowledge of basic I did not know how to peek and poke.

uilium