Subject: Re: [TI994A] Re: READing DATA in XB

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 08:01:09 -0600

So, 

100 X=INT(RND*200)+1
110 GOSUB X
.
.
200 RESTORE 1000
201 RESTORE 1010
202 RESTORE 1020
.
.
.

Is that construct possible?

Sent from Huawei Mobile

[email-masked] wrote:

>Owen...
>
>You can't use variables with RESTORE.  Your randomizing will have to be with RESTORE statements via something like ON X GOTO ... or ON X GOSUB ..., I'm afraid.
>
>...lee
>
>
>--- In [email-masked], Owen Brand <owen.brand@...> wrote:
>>
>> Not at the console now so I can't test, but Im doing some planning in my head while running errands.  If I want to randomize which DATA lines are READ into my program, Can I do a RND function to place a value into a variable, then do a RESTORE X?  If so, then what would the protocol be to select which value within that DATA line is READ?  Or will the READ necessarily begin with the first value in the DATA statement?
>> 
>> Sorry if this is obvious, im without a manual and terminal right now.  :)  Just hoping to get some stuff straight in my head so I can get a project finished this evening.
>> 
>> Thanks
>> 
>> 
>> Owen
>> 
>> 
>> 
>> 
>> Sent from Huawei Mobile
>>
>
>

---

From: [email-masked]
Date: Fri, 26 Apr 2013 14:23:20 -0000

Something like that, yes.  If you have just statements 200, 201 and 202,
you would need to change your code to
100 X=INT(RND*2)+1110 ON X GOSUB 200,201,202...200 RESTORE
1000::RETURN201 RESTORE 1010::RETURN202 RESTORE 1020::RETURN
...lee
--- In [email-masked], Owen Brand  wrote:
> lee@... wrote:
> >You can't use variables with RESTORE.  Your randomizing will have to
be with RESTORE statements via something like ON X GOTO ... or ON X
GOSUB ..., I'm afraid.
> >
> >...lee
> >
> >
> >--- In [email-masked], Owen Brand owen.brand@ wrote:
> >>
> >> Not at the console now so I can't test, but Im doing some planning
in my head while running errands.  If I want to randomize which DATA
lines are READ into my program, Can I do a RND function to place a value
into a variable, then do a RESTORE X?  If so, then what would the
protocol be to select which value within that DATA line is READ?  Or
will the READ necessarily begin with the first value in the DATA
statement?
> >>
> >> Sorry if this is obvious, im without a manual and terminal right
now.  :)  Just hoping to get some stuff straight in my head so I can get
a project finished this evening.

---

From: [email-masked]
Date: Fri, 26 Apr 2013 14:26:50 -0000

Oops!  I screwed up line 100!  It should be
100 X=INT(RND*3)+1
...lee
--- In [email-masked], lee@... wrote:
> > lee@ wrote:

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 07:48:13 -0700 (PDT)

There will probably be 18-27 different DATA lines which will be randomized.  Not sure how many just yet... depends on how much space I have left in my program.  =)

HOWEVER... I might be able to cut down the AMOUNT of lines if I could call for a specific segment or record in that DATA line...  For instance...

2000 DATA "B. RUTH", 1000, "H. WAGNER", 983, "J. BENCH", 831.........

If I could RESTORE 2000,3 or something like that (forgive my ignorance of syntax... I haven't done this in a while) in order to specify the exact piece of DATA in the line, that would be actually quite helpful.  I haven't dealt with READ and DATA much as I have normally in the past hard coded all my information into variables and string variables... The only reason I'm trying this is so I can create some variation and randomization in the program without hard-coding so many pieces of DATA... We'd be talking somewhere along the lines of 45 string variables and 45 numeric variables to be coded and carried whether they were needed or not by the program.  Not very efficient.  =)

Owen

________________________________
 From: "[email-masked]" <[email-masked]>
To: [email-masked] 
Sent: Friday, April 26, 2013 8:26 AM
Subject: [TI994A] Re: READing DATA in XB

100 X=INT(RND*3)+1
...lee

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 07:52:02 -0700 (PDT)

I would post the code here, but it's quite a long listing already with a bunch of notes and comments... If anyone's interested in the program, go "here" for the most recent listing

________________________________
 From: Owen Brand <[email-masked]>
To: "[email-masked]" <[email-masked]> 
Sent: Friday, April 26, 2013 8:48 AM
Subject: Re: [TI994A] Re: READing DATA in XB

Owen

  

100 X=INT(RND*3)+1
...lee

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 08:39:05 -0700 (PDT)

Had to delete that code... Atariage jacked up all my formatting and ruined the whole thing.  I'll re-post later today.  Sorry guys.

Sent: Friday, April 26, 2013 8:52 AM

  

Owen

  

100 X=INT(RND*3)+1
...lee

---

From: [email-masked]
Date: Fri, 26 Apr 2013 15:56:56 -0000

Sorry, Owen.  You can't jump into the middle of a DATA statement.  And, I'm pretty sure there's a limit to how many statement numbers you can have in an "ON X GO..." statement---whatever the maximum statement length happens to be, I suppose.  Perhaps you could use arrays read from disk for specific teams.

...lee

--- In [email-masked], Owen Brand <owen.brand@...> wrote:
>  From: "lee@..." <lee@...>
> --- In [email-masked], lee@ wrote:
> >

---

From: "Tony" <[email-masked]>
Date: Fri, 26 Apr 2013 16:03:46 +0000

That code box on Atariage doesn't work very well. I have much better success posting code here with a fixed width font, 'fixedsys' seems to work best. 

-----Original Message-----
From: Owen Brand <[email-masked]>
Sender: [email-masked]
Date: Fri, 26 Apr 2013 08:39:05 
To: [email-masked]<[email-masked]>
Reply-To: [email-masked]
Subject: Re: [TI994A] Re: READing DATA in XB

  

  

Owen

  

100 X=INT(RND*3)+1
...lee

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 09:07:22 -0700 (PDT)

Yea, the code is EXTREMELY sensitive to formatting now because I've changed all the code to work with the BBS system.  Every display is a long string of quotations and "&STR$(BBFLG) and such... one space off and you're bonkers.  The code box erased all the empty spaces inside the quotations... Yea, it was a jumbled mess.  =)

Thanks for the heads up Tony.... For preservation, I will try posting here in the future.

Owen

________________________________
 From: Tony <[email-masked]>
To: [email-masked] 
Sent: Friday, April 26, 2013 10:03 AM
Subject: Re: [TI994A] Re: READing DATA in XB

From:  Owen Brand <[email-masked]> 
Sender:  [email-masked] 
Date: Fri, 26 Apr 2013 08:39:05 -0700 (PDT)
To: [email-masked]<[email-masked]>
ReplyTo:  [email-masked] 
Subject: Re: [TI994A] Re: READing DATA in XB

  

  

Owen

  

100 X=INT(RND*3)+1
...lee

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 09:09:01 -0700 (PDT)

Thanks Lee... I will be doing just that for the final XB version, but for this BBS version, I was hoping to have a self-contained XB program.  =)

I was hoping to have a .dsk file to send to Tim and Kyle today to try out on Heatwave, but it's looking more and more like it'll be tomorrow.  Can't catch a break, man!!!  =)

Owen

Sent: Friday, April 26, 2013 9:56 AM

...lee

--- In [email-masked], Owen Brand <owen.brand@...> wrote:
>
> There will probably be 18-27 different DATA lines which will be randomized. Â Not sure how many just yet... depends on how much space I have left in my program. Â =)
> 
> HOWEVER... I might be able to cut down the AMOUNT of lines if I could call for a specific segment or record in that DATA line... Â For instance...
> 
> If I could RESTORE 2000,3 or something like that (forgive my ignorance of syntax... I haven't done this in a while) in order to specify the exact piece of DATA in the line, that would be actually quite helpful. Â I haven't dealt with READ and DATA much as I have normally in the past hard coded all my information into variables and string variables... The only reason I'm trying this is so I can create some variation and randomization in the program without hard-coding so many pieces of DATA... We'd be talking somewhere along the lines of 45 string variables and 45 numeric variables to be coded and carried whether they were needed or not by the program. Â Not very efficient. Â =)
> 
> 
> Owen
> 
> 
> Â  
> Oops! Â I screwed up line 100! Â It should be
> 
> 100 X=INT(RND*3)+1
> >>
> >>
> ...lee
>

---

From: [email-masked]
Date: Fri, 26 Apr 2013 16:28:19 -0000

Yeah, on AtariAge, I always post a text file for code I expect someone else might want to cut and paste.

...lee

--- In [email-masked], Owen Brand <owen.brand@...> wrote:
>  From: Tony <tonyknerr@...>
> From:  Owen Brand <owen.brand@...> 
>  From: Owen Brand <owen.brand@...>
>  From: Owen Brand <owen.brand@...>

---

From: "Jacques" <[email-masked]>
Date: Fri, 26 Apr 2013 13:38:56 -0300

Owen,

You could probably use SEG$ to extract a section of a long string but all 
your DATA statements would have to be strings with player names and their 
averages at pre-fixed intervals. Having player averages as strings might 
also save you some program space. Of course, you would have to convert a 
string number to a numeric to do calculations.

Just some thoughts,

Jacques

-----Original Message----- 
From: [email-masked]
Sent: Friday, April 26, 2013 12:56 PM
To: [email-masked]
Subject: [TI994A] Re: READing DATA in XB

Sorry, Owen.  You can't jump into the middle of a DATA statement.  And, I'm 
pretty sure there's a limit to how many statement numbers you can have in an 
"ON X GO..." statement---whatever the maximum statement length happens to 
be, I suppose.  Perhaps you could use arrays read from disk for specific 
teams.

...lee

--- In [email-masked], Owen Brand <owen.brand@...> wrote:
>
> There will probably be 18-27 different DATA lines which will be 
> randomized. Â Not sure how many just yet... depends on how much space I 
> have left in my program. Â =)
>
> HOWEVER... I might be able to cut down the AMOUNT of lines if I could call 
> for a specific segment or record in that DATA line... Â For instance...
>
> If I could RESTORE 2000,3 or something like that (forgive my ignorance of 
> syntax... I haven't done this in a while) in order to specify the exact 
> piece of DATA in the line, that would be actually quite helpful. Â I 
> haven't dealt with READ and DATA much as I have normally in the past hard 
> coded all my information into variables and string variables... The only 
> reason I'm trying this is so I can create some variation and randomization 
> in the program without hard-coding so many pieces of DATA... We'd be 
> talking somewhere along the lines of 45 string variables and 45 numeric 
> variables to be coded and carried whether they were needed or not by the 
> program. Â Not very efficient. Â =)
>
>
> Owen
>
>

------------------------------------

Yahoo! Groups Links

---

From: Owen Brand <[email-masked]>
Date: Fri, 26 Apr 2013 09:47:18 -0700 (PDT)

Thank you jacques!  I hadn't thought about using SEG$ for this... But it is a good idea.  I'd have to do some fancy stuff to make it work properly.  =)

As you said, if the player names are all different lengths, one would have to either group same-length names into a string or adjust the way the names are displayed to fit a pre-designated pattern... One way or another, it IS a possibility.  

I'll give it some thought.  Much obliged.  =)

Owen

________________________________
 From: Jacques <[email-masked]>
To: [email-masked] 
Sent: Friday, April 26, 2013 10:38 AM
Subject: Re: [TI994A] Re: READing DATA in XB

Owen,

Just some thoughts,

Jacques

-----Original Message----- 
From: [email-masked]
Sent: Friday, April 26, 2013 12:56 PM
To: [email-masked]
Subject: [TI994A] Re: READing DATA in XB

...lee

Yahoo! Groups Links

---

From: [email-masked]
Date: Fri, 26 Apr 2013 20:17:10 +0000 (UTC)

Owen 

If the 32K is availiable then you can use the lower 8K for quick access in RXB for example: 

100 FOR X=8192 to 8192+48 step 8 
110 READ string 
120 CALL MOVES("$R",8,string,X) ! Lower 8K now has 6 strings 8 characters long and spaces 8 apart. (moves $tring to Ram) 
130 next X 
140 DATA "string1","string2","string3","string4","string5","string6" 
150 ! line to calculate the string to use here like address=8192+(value*8) thus value 0*8=0 .....6*8=48 this gives your range of 6 strings. 
160 CALL MOVES("R$",8,S,stringvariable) ! this loads the string. 

I suspect this is faster then RESTORE and DATA and READ as it eliminates a line and uses RAM to store strings. 

Rich 

P.S. normal XB only has CALL LOAD and CALL PEEK that is slower then hell. 

----- Original Message -----
From: "Owen Brand" <[email-masked]> 
To: [email-masked] 
Sent: Friday, April 26, 2013 9:47:18 AM 
Subject: Re: [TI994A] Re: READing DATA in XB 

Owen 

Owen, 

Just some thoughts, 

Jacques 

-----Original Message----- 
From: [email-masked] 
Sent: Friday, April 26, 2013 12:56 PM 
To: [email-masked] 
Subject: [TI994A] Re: READing DATA in XB 

...lee 

--- In [email-masked] , Owen Brand <owen.brand@...> wrote: 
> --- In [email-masked] , lee@ wrote: 
> > 
> > --- In [email-masked] , Owen Brand wrote: 
> > > 
> > > So, 
> > > 
> > > 100 X=INT(RND*200)+1 
> > > 110 GOSUB X 
> > > . 
> > > . 
> > > 200 RESTORE 1000 
> > > 201 RESTORE 1010 
> > > 202 RESTORE 1020 
> > > . 
> > > . 
> > > . 
> > > 
> > > >--- In [email-masked] , Owen Brand owen.brand@ wrote: 
> > > >> 

Yahoo! Groups Links

---

From: "owenbrand99er" <[email-masked]>
Date: Sat, 27 Apr 2013 05:34:48 -0000

I'll try to post this code here... If you want to DL the file, I'll also
post the link.... 
<http://atariage.com/forums/topic/210628-new-baseball-game-for-the-ti-99\
4a/page__st__150#entry2743038> 
<http://atariage.com/forums/index.php?app=core&module=attach&section=att\
ach&attach_id=288283> HERE
<http://atariage.com/forums/topic/210628-new-baseball-game-for-the-ti-99\
4a/page__st__150#entry2743038>
***Looking at the code in this eMail, I'm not sure if it's going to be
properly formatted either... The code is so format sensitive now with
the adjustments I've made for PRINT statements.  We'll see.  The link
takes you straight to the download if you're an AA member.  If not, and
you want to try it out (assuming the copy and paste isn't perfect from
here), I'll be happy to eMail it to you directly.

Owen

**REM THESE LINES SET UP INITIAL VARIABLES.  EACH BASE HAS A FLAG AND
PLAYER NAME ASSOCIATED WITH IT10 DIM SCO(2), P$(2), C$(2), B$(2),
BB$(2), BBB$(2), SS$(2), LF$(2), CF$(2), RF$(2), BO(2), HIT(2), WH(2)20
DIM PBSC(2), PSC(2), CSC(2), BSC(2), BBSC(2), BBBSC(2), SSSC(2),
LFSC(2), CFSC(2), RFSC(2)100 BAP=0 :: INN=1 :: OUT=3 :: BFLG=0 ::
BBFLG=0 :: BBBFLG=0 :: HPFLG=0 :: SCO(1)=0 :: SCO(2)=0 :: TAP=1 :: INF=0
:: RFLG=0105 BO(1)=0 :: BO(2)=0 :: HIT(1)=0 :: HIT(2)=0110 RANDOMIZE120
REM BASEBALL SIM
**REM THESE ARE THE STRING VARIABLES CARRYING THE PLAYERS' NAMES WITH
THEM
***REM HOME TEAM130 P$(1)="W. JOHNSON" :: PBSC(1)=450 :: PSC(1)=939135
C$(1)="J. BENCH" :: CSC(1)=818140 B$(1)="L. GEHRIG" :: BSC(1)=990145
BB$(1)="R. HORNSBY" :: BBSC(1)=995150 BBB$(1)="E. MATHEWS" ::
BBBSC(1)=885155 SS$(1)="H. WAGNER" :: SSSC(1)=857160 LF$(1)="T.
WILLIAMS" :: LFSC(1)=995165 CF$(1)="J. DIMAGGIO" :: CFSC(1)=997170
RF$(1)="B. RUTH" :: RFSC(1)=1000
***REM AWAY TEAM
175 P$(2)="NOLAN RYAN" :: PBSC(2)=300 :: PSC(2)=853180 C$(2)="Y. BERRA"
:: CSC(2)=830185 B$(2)="T. HELTON :: BSC(2)=962190 BB$(2)="R. CAREW" ::
BBSC(2)=822195 BBB$(2)="A. RODRIGUEZ" :: BBBSC(2)=944200 SS$(2)="C.
RIPKEN JR." :: SSSC(2)=788205 LF$(2)="B. WILLIAMS" :: LFSC(2)=858210
CF$(2)="P. ROSE" :: CFSC(2)=784215 RF$(2)="M. CUDDYER" :: RFSC(2)=798

220 CALL CL
**REM BEGIN GAME LOOP
240 IF OUT>2 THEN GOSUB 1200241 IF INN>8 THEN GOSUB 1600245 GOSUB 520

***SCREEN DISPLAY248 IF INF=1 THEN CALL C("                    TOP")
ELSE CALL C("                    BOT")250 CALL C(" OUTS: "&STR$(OUT)&"
INNING: "&STR$(INN))251 CALL C(""):: CALL C("")252 CALL C(" HOME:
"&STR$(SCO(1)))253 CALL C(" AWAY: "&STR$(SCO(2)))254 FOR I=1 TO 4 ::
CALL C("") :: NEXT I255 TAP=TAP XOR 3256 CALL C("NOW PITCHING:"):: CALL
C(P$(TAP)):: CALL C("")257 TAP=TAP XOR 3259 CALL C("NOW BATTING:")::
CALL C(BAP$)260 CALL C("                 "&STR$(BBFLG))261 CALL C("
"&STR$(BBBFLG)&" "&STR$(BFLG))262 CALL C("                
"&STR$(BAP)):: CALL C("")
MAIN LOOP
280 GOSUB 1800 !This sends program control to the batter/pitcher matchup
SUB320 CALL CL340 IF SFDICE=1 THEN GOSUB 360 ELSE GOSUB 440 !If "reach
base," gosub 360, if "out" gosub 440350 FOR I=1 TO 900 :: NEXT I :: CALL
CL :: GOTO 240

**********************************************************REM THIS IS
THE "YOU REACH BASE AND HERE'S HOW" SUB
360 CALL CL370 ON WHDICE GOSUB 380,390,400,410,420,430 :: RETURN
**REM WALK, RUNNERS ON BASE ADVANCE ONLY IF FORCED
380 CALL C("WALK")381 IF BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN
HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=BBFLG :: BBFLG=BFLG ::
BFLG=BAP;382 IF BBFLG>0 AND BFLG>0 THEN BBBFLG=BBFLG :: BBFLG=BFLG ::
BFLG=BAP383 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=BAP384 BFLG=BAP385 RETURN
**REM SINGLE, ALL RUNNERS ADVANCE ONE BASE
390 CALL C("SINGLE") :: IF BBBFLG>0 THEN HPFLG=BBBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0391 IF BBFLG>0 THEN BBBFLG=BBFLG ::
BBFLG=0392 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0393 BFLG=BAP394 RETURN
400 CALL C("SINGLE") :: IF BBBFLG>0 THEN HPFLG=BBBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0401 IF BBFLG>0 THEN BBBFLG=BBFLG ::
BBFLG=0402 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0403 BFLG=BAP404 RETURN
**REM DOUBLE, ALL RUNNERS ADVANCE TWO BASES
410 CALL C("DOUBLE") :: IF BBBFLG>0 THEN HPFLG=BBBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0411 IF BBFLG>0 THEN HPFLG=BBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBFLG=0412 IF BFLG>0 THEN BBBFLG=BFLG :: BFLG=0
413 BBFLG=BAP414 RETURN
**REM TRIPLE, ALL RUNNERS ADVANCE THREE BASES
420 CALL C("TRIPLE") :: IF BBBFLG>0 THEN HPFLG=BBBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0421 IF BBFLG>0 THEN HPFLG=BBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBFLG=0422 IF BFLG>0 THEN HPFLG=BFLG ::
SCO(TAP)=SCO(TAP)+1 :: BFLG=0423 BBBFLG=BAP424 RETURN
**REM HOME RUN, ALL RUNNERS (PLUS BATTER AT PLATE) SCORE
430 CALL C("HOME RUN") :: IF BBBFLG>0 THEN HPFLG=BBBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0431 IF BBFLG>0 THEN HPFLG=BBFLG ::
SCO(TAP)=SCO(TAP)+1 :: BBFLG=0432 IF BFLG>0 THEN HPFLG=BFLG ::
SCO(TAP)=SCO(TAP)+1 :: BFLG=0433 HPFLG=BAP :: SCO(TAP)=SCO(TAP)+1434
RETURN
*************************************************************
**REM THIS IS THE "YOU'RE OUT, AND HERE'S HOW" SUB
440 CALL CL450 ON WHDICE GOSUB 490,470,480,500,510,460 :: RETURN
**REM STRIKEOUT, NO RUNNERS ADVANCE460 CALL C("STRIKEOUT") :: OUT=OUT+1
:: RETURN
**REM GROUNDOUT, ALL RUNNERS ADVANCE A BASE
470 CALL C("GROUNDOUT")471 OUT=OUT+1 :: IF OUT>2 THEN RETURN472 GOSUB
1500 :: IF RFLG>0 THEN CALL C("ALL RUNNERS ADVANCE")474 IF BBBFLG>0 THEN
HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0475 IF BBFLG>0 THEN
BBBFLG=BBFLG :: BBFLG=0476 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0477 RETURN
**REM GROUNDOUT, RUNNERS ADVANCE IF FORCED
480 CALL C("GROUNDOUT")481 OUT=OUT+1 :: IF OUT>2 THEN RETURN482 GOSUB
1500 :: IF RFLG>0 THEN CALL C("RUNNERS ADVANCE IF FORCED")484 IF
BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
:: BBBFLG=BBFLG :: BBFLG=BFLG :: BFLG=0 :: RETURN485 IF BBFLG>0 AND
BFLG>0 THEN BBBFLG=BBFLG :: BBFLG=BFLG :: BFLG=0 :: RETURN486 IF BFLG>0
THEN BBFLG=BFLG :: BFLG=0487 RETURN
**REM GROUNDOUT, DOUBLE PLAY IF RUNNER ON 1ST AND LESS THAN 2 OUTS, ALL
OTHERS ADVANCE
490 CALL C("GROUNDOUT")491 OUT=OUT+1 :: IF OUT>2 THEN RETURN495 IF
BFLG>0 THEN OUT=OUT+1 :: BFLG=0 :: CALL C("DOUBLE PLAY!") :: IF OUT>2
THEN RETURN496 IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 ::
BBBFLG=0497 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0498 GOSUB 1500 :: IF
RFLG>0 THEN CALL C("RUNNERS ADVANCE")499 RETURN
**REM SHALLOW FLYOUT.  NO RUNNERS ADVANCE
500 CALL C("SHALLOW FLYOUT")506 OUT=OUT+1 :: IF OUT>2 THEN RETURN507
GOSUB 1500 :: IF RFLG>0 THEN CALL C("RUNNERS HOLD")508 RETURN
**REM DEEP FLYOUT.  ONLY RUNNERS ON 2ND AND 3RD ADVANCE
510 CALL C("DEEP FLYOUT")511 OUT=OUT+1 :: IF OUT>2 THEN RETURN515 GOSUB
1500 :: IF RFLG>0 THEN CALL C("RUNNERS ON SECOND OR THIRD  ADVANCE")516
IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0517 IF
BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0518 RETURN

************************************************************************\
***
**REM THIS IS THE "GO THROUGH BATTING ORDER AND DISPLAY BATTER'S NAME"
SUB
520 BAP=BAP+1521 IF BAP>9 THEN BAP=1530 IF BAP=1 THEN BAP$=B$(TAP)::
BAPSC=BSC(TAP)531 IF BAP=2 THEN BAP$=BB$(TAP):: BAPSC=BBSC(TAP)535 IF
BAP=3 THEN BAP$=BBB$(TAP):: BAPSC=BBBSC(TAP)536 IF BAP=4 THEN
BAP$=SS$(TAP):: BAPSC=SSSC(TAP)540 IF BAP=5 THEN BAP$=LF$(TAP)::
BAPSC=LFSC(TAP)541 IF BAP=6 THEN BAP$=CF$(TAP):: BAPSC=CFSC(TAP)545 IF
BAP=7 THEN BAP$=RF$(TAP):: BAPSC=RFSC(TAP)546 IF BAP=8 THEN
BAP$=C$(TAP):: BAPSC=CSC(TAP)550 IF BAP=9 THEN BAP$=P$(TAP)::
BAPSC=PBSC(TAP)551 TAP=TAP XOR 3552 POM=PSC(TAP)553 TAP=TAP XOR 3560
RETURN

************************************************************************\
***
**REM THIS IS THE "3 OUTS, NOW CHANGE SIDES" SUB

1200 INF=INF+1 :: GOSUB 1600 :: CALL CL1210 IF INF>2 THEN INF=1 ::
INN=INN+11215 CALL C("         INNING #"&STR$(INN)) :: FOR I=1 TO 10 ::
CALL C(""):: NEXT I :: FOR I=1 TO 500 :: NEXT I1220 IF INF=2 THEN CALL
C("     HOME TEAM UP TO BAT")1250 IF INF=1 THEN CALL C("     AWAY TEAM
UP TO BAT")1260 FOR I=1 TO 10 :: CALL C(""):: NEXT I1264 FOR I=1 TO 500
:: NEXT I1265 BO(TAP)=BAP1266 TAP=TAP XOR 31267 BAP=BO(TAP)1268 OUT=0 ::
BFLG=0 :: BBFLG=0 :: BBBFLG=01269 CALL CL1270 RETURN

************************************************************************\
***
**REM THIS IS THE "CHECK IF THERE ARE ANY BASE RUNNERS" SUB
1500 IF BFLG>0 THEN RFLG=1 :: RETURN1510 IF BBFLG>0 THEN RFLG=1 ::
RETURN1520 IF BBBFLG>0 THEN RFLG=1 :: RETURN1530 RFLG=0 :: RETURN
************************************************************************\
***
**REM THIS IS THE "CHECK FOR A TIE AT THE END OF THE GAME" SUB
1600 IF SCO(1)=SCO(2) THEN RETURN1605 IF INN>8 THEN GOSUB 17001610
RETURN
************************************************************************\
***
**REM THIS IS THE "END THE GAME IF IT'S THE BOTTOM OF THE LAST INNING"
SUB (AND WALKOFF)
1700 IF INF=1 THEN RETURN1705 IF SCO(1)>SCO(2) THEN CALL CL :: CALL
C("GAME OVER")1706 CALL C("HOME: "&STR$(SCO(1))) :: CALL C("AWAY:
"&STR$(SCO(2))) :: END1708 IF SCO(1)<SCO(2) THEN CALL CL :: CALL C("GAME
OVER")1709 CALL C("HOME: "&STR$(SCO(1))) :: CALL C("AWAY:
"&STR$(SCO(2))) :: END1710 RETURN

************************************************************************\
***
**REM BATTER/PITCHER MATCHUP SUB

1800 BCH=INT(RND*BAPSC)+1 :: PCH=INT(RND*POM)+1 !Batter vs. hitter
matchup based on score1805 IF BCH>PCH THEN SFDICE=1 ELSE SFDICE=2 !If
the batter wins, SFDICE is 1, otherwise, 21810 WHDICE=INT(RND*6)+11811
IF TAP=1 THEN 1812 ELSE 18151812 CALL C("1) AGGRESSIVE HITTING?"):: CALL
C("2) CAUTIOUS HITTING?"):: GOTO 18201815 CALL C("1) AGGRESSIVE
PITCHING?"):: CALL C("2) CAUTIOUS PITCHING?")1820 !REM CALL KEY FOR 1 or
2--- this will help determine the outcome of the at-bat1825 CALL
KEY(0,K,S):: IF S=0 THEN 18201830 IF K<49 THEN 1820 ELSE IF K>50 THEN
1820 !!!1840 K=K-48 :: IF K=1 THEN 1850 ELSE 1880 !If 1 is pressed,
continue with program, else goto 18801850 WHDICE=WHDICE+2 :: IF WHDICE>6
THEN WHDICE=6 :: GOTO 1890 !aggressive play, increase big result1880
WHDICE=WHDICE-2 :: IF WHDICE<1 THEN WHDICE=1 !cautious play, decrease
big result1890 RETURN
**1885 for
test********************************************************************\
*******
**REM -BBS SPECIFIC "PRINT" CALL
2000 SUB C(A$):: PRINT A$ :: SUBEND
************************************************************************\
***
**REM -BBS SPECIFIC "CALL CLEAR"
3000 SUB CL :: CALL CLEAR :: SUBEND