problem with game from "vintage basic"

Discussions related to graphics (2D and 3D), animation and games programming
Post Reply
tsmspace
Posts: 3
Joined: Sun 16 Dec 2018, 00:40

problem with game from "vintage basic"

Post by tsmspace » Wed 19 Dec 2018, 13:33

I am trying to play the games on the vintage-basic page, from the title 101 Basic Games.

I have been copying and pasting from the .bas files to make sure the game works, because I always type so many errors. This game, however, isn't working from the paste. It gives the error "no such variable at 840", and sure enough, I can't find the variable Q defined before that line. I looked a little, but don't know what Q is up to, or where I should try to define it.

is anyone familiar with the game?? (it's mancala. I suppose I could imagine how a python mancala program would work that looks identical, but I'm not yet up for the task, being such a noob).

guest
Posts: 268
Joined: Mon 02 Apr 2018, 09:12

Re: problem with game from "vintage basic"

Post by guest » Wed 19 Dec 2018, 14:45

tsmspace wrote:
Wed 19 Dec 2018, 13:33
sure enough, I can't find the variable Q defined before that line. I looked a little, but don't know what Q is up to, or where I should try to define it.
What dialect of BASIC was this program originally written for? If it was for a Microsoft BASIC (or one of its descendants) then variables that have never previously been defined are assumed to be zero (in the case of a numeric variable) or an empty string (in the case of a string variable). So it may simply be a case of adding:

Code: Select all

      Q = 0
somewhere near the beginning of the program. Of course you can expect to encounter other issues that arise because of incompatibilities between BASIC dialects, but at least in the case of 'No such variable' it's easily fixed.

Post Reply