Nibbles is a QBASIC1
game created by Microsoft2
in 1990, where 1 or 2 player
s must control a snake
(or snakes) as they move around a playing area trying to eat numbers which appear.
Playing the game
To play the game, you must run the NIBBLES.BAS file which came with your version of DOS (or if you've got it off of your Windows 95 CD, or if you've downloaded it). Pick whether you want to play a 1 or 2 player game. Select a game speed from 1 to 100 inclusive. Choose whether or not you want the game to get progressively faster, then pick either monochrome or colour display. Now, move the snake around the playing screen with the four arrow keys, and run into the numbers that appear. Once you've eaten a 1, it disappears, your score goes up by 100, and a number 2 appears, which you must then eat.
Once you have eaten 9 numbers, the next level starts. Each level is harder than the next, due to the addition of barriers. If you collide with the edge of the playing field, a barrier, or your own tail, then you lose a life.
In the original version of the game, there are 10 levels, and you start with 5 lives. Each time you eat a number, you get (that number * 100) points, so you can gain a maximum of 4,500 points per level. Each time you lose a life by hitting a wall or yourself, you lose 1,000 points. You can pause the game by pressing "p".
The entire game uses ASCII characters only (no flashy graphics), and the standard 80x25 display size.
Getting the game
Edited versions of the game can be found on the WWW. The original version can be downloaded from http://members.aol.com/bigbutter/NibblesHomepage/nibbles.bas
Once you've downloaded the game, just load it in QBASIC and run it.
Fixing the game
If you have a reasonably fast computer which has been made in the last few years, the program may crash with a "Division by zero" error on line 47 of the GetInputs subroutine. This is because Nibbles actually works out an approximate speed for your computer by dividing a number by the time it takes your computer to do a FOR..NEXT loop 1000 times. The way in which QBASIC times this is only accurate to about 1/10 of a second, so if it takes less than this to do 1000 loops it divides by zero.
To fix this, we need to make a small kludgy edit to the program. Go to line 55 of the subroutine PlayNibbles and change
FOR a# = 1 TO curspeed: NEXT a#
FOR a# = 1 TO 100000: NEXT a#
Then go to line 47 of the subroutine GetInputs and put an apostrophe at the start of the line (this makes it into a comment rather than a piece of code).
If this runs too slowly for you, change 100000 to a smaller number. If it's too fast, change 100000 to a bigger number.
1 In this writeup, I'll use the terms QBASIC and QuickBASIC interchangably, even though one is a free interpreter and the other is a $100 compiler which you pay money for.
2 TheBooBooKitty informs me that MS did not actually make this game, and that it has been around since the early 70s, under a variety of different names. However, it is interesting to note that MS have put a copyright on their version of the game. (jrn elaborates: "you can't copyright the idea of a game, but you can copyright source code. So it's the implementation, not the game, which was copyrighted")
3 2004.04.14 at 20:48 Orange Julius says re Nibbles: To second TBBK's assertion, this game is very much pre-Microsoft. DECs in the 1980s had this game, executable under the name 'worm'. The worm's head was an @ symbol.
The contents of this writeup are in the public domain.