Home  » Games

Nibbles

on DOS

The good old snake game, implemented in QBasic with source code distributed with MS-DOS 5 onwards...

Nibbles

When DOS first came out, packaged along with it was GWBASIC, an interpreter for the BASIC language which was a good starting point to learn programming in the 80s. Microsoft also brought out a commercial tool called QuickBASIC, with a great IDE and a compiler, which did away with the line numbering concepts, and brought in more functional programming to do away with BASIC’s notorious GOTO statement.

QBasic was a pared-down free version of QuickBASIC, bundled along with MS-DOS 5.0 and later. To demonstrate what QBasic was capable of, bundled along with it were a few programs, and the magnificent NIBBLES.BAS

NIBBLES is the classic snake game. You are a continuously moving snake, and you can turn left or right. Your aim is to eat all the numbers which pop up on screen, while trying not to crash into any walls, or even your own tail. The catch is that as you eat more, you grow progressively longer.

The game is written for an 80x25 text screen, and by some clever use of ASCII block symbols, the screen is effectively 80 by 50. As you move to higher levels, the game progressively gets more complex, with walls, and obstacles which keep popping up. There is even a two player version, where there are two snakes on screen, with different keys to control each snake.

The game is essentially a throwaway, with source released and no commercial entanglements. Despite that, the game is truly engaging and addictive. One could spend hours nudging the snake this way and that to get to those numbers. Hours and hours. There was nothing essentially original about this game. Snake games existed well before this, and have continued to exist to this day with MMORPG versions like Slither.IO.

But NIBBLES.BAS was the most engaging, not half because of an audience which got addicted to it out of sheer boredom in the pre-solitaire world.