AllExperts > Experts 
Search      

Qbasic, Quickbasic

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Qbasic, Quickbasic Answers
Question Library

Ask a question about Qbasic, Quickbasic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Don 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.

 
   

You are here:  Experts > Computing/Technology > Basic > Qbasic, Quickbasic > qbasic slot program with arrays

Topic: Qbasic, Quickbasic



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

DIM Fruits%(Wheels%,Fruits%)
DIM Tymer!(Wheel%)  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.