Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with exchanging Data Numbers in Qbasic

Status
Not open for further replies.

ISOTOPES

Programmer
May 31, 2001
1
US
We're trying to write a text based basketball game that relies on real-life stats instead of an arcade style play.
To do this we import real players statistics into a qbasic file ie sixers.dat

an example would be
"Bell Raj","sixers",1,5,6,1,4,1,3,0,0,0,0,1,1,0,2,1
"McLeod Ra","sixers",2,1,15,1,1,0,1,0,0,0,1,1,0,0,1,2
"Miller Ant","sixers",4,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0

this would be used like this
input #1,name$,p$,g,m,fg,fga,tpt,3pta,ft,fta,ast,oreb,dreb,
stl,blk,turno,pf

now I can get the info in and out of the program fine. However the problem I need help with is this.

Let's say we have a starting lineup of
1. mutombo
2. hill
3. lynch
4. iverson
5. snow

and our other players are lets say
6. McKie
7. Bell
8. MacCollough

Ok, now how do I assign data to these players during the game?

Each team would have 12 around 12 positions so I take it I would have to have the program auto assign these like
homeplayer(1) - homeplayer(2) - homeplayer(3)

how would you go about doing that? How do I assign the different numbers so essentially everytime HILL would score a point I could credit him (player 2) or if Iverson were to get a rebound I could give it to him (player 4) I know there has to be a simple solution I just can not figure it out.

Thanks,
Jamie
isotopes@seeyouonline.com
 
You probably are needing to assign the data into an array. Loading it in at the start, accessing when needed, updating it during the course of the game , and writing it out at the end.
Has been a while so I'll probably screw this up but with an array p(9,15) point upgrade for player 5 for example would be p(5,8)=p(5,8)+2.
Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top