AboutDon Schullian Expertise I`ve worked in BASIC since the Commodore days and maintain a web site part of which is devoted to helping others with thier problems. I`m proficient in all versions of PowerBASIC but cross over to QuickBASIC and Qbasic frequently.
Expert: Don Schullian Date: 6/10/2008 Subject: qbasic slot program with arrays
Question hi i need help setting up the arrays for each reel to randomly show the fruits and when a is hit 1st reel stop when s is hit the 2nd one stops and when d is hit the 3rd reel stops spining
Answer Hi John,
This is sounding speciously like homework and I've not had to do homework for quite a few decades now. ;) That said, I'll give you a push in the right direction then, either you convince me this isn't homework and/or you show me come code.
The array has to have sufficient elements in it to support all 3 wheels and f% number of fruits. The easist way to do this is to have one array do both.
You'll also want an array for the timer of each wheel. The zeroth wheel will last the longest then the next two will be relatively quick. I'd compute these times before starting the spin by using the RND function and limiting the zeroth wheel to, say, between 8 and 11 seconds. The next two wheels will be wheel 0's time plus something like 2 to 3 seconds. Got it?
Wheels% = 2 ' that's 3 total
Fruits% = 14 ' that's 15 total