Hello Everyone,
I need to add league tables to my NFL game. Once the actual game finishes, there is a menu of teams where you can select the number of each team to correspond with that week's fixtures.
Example:
FOR e = 1 to 64 STEP 2
READ t,t$
DATA 1,"RAIDERS",2,"BRONCOS",3,"CHIEFS",4,"CHARGERS" etc.
INPUT "How many games?";g
INPUT "Home Team";h
INPUT "Road Team";r
I then need the game to randomly generate match results, and finally update league tables.
Example:
RAIDERS 24-17 CHIEFS
BRONCOS 10-21 CHARGERS
W L
RAIDERS 3 1
CHIEFS 2 2
BRONCOS 1 3
CHARGERS 0 4
I have the Results aspect working, but need a more efficient way of accomplishing this as I am running short on memory!
Any help would be appreciated.
144kNeo
Updating NFL League Tables
Updating NFL League Tables
Last edited by 144kneo on Sat Apr 12, 2025 11:02 pm, edited 1 time in total.
Re: Updating NFL League Tables
Hi 144kNeo,
Welcome aboard.
For which Spectrum ? 16k or 48k...
In your exemple:
It will be nice to get memory room in the DATA.
DIM t$(32)
FOR e = 1 to 64 STEP 2: REM 65 ???
READ t$((e+1)/2)
DATA RAIDERS,BRONCOS,CHIEFS,CHARGERS
Don't understand your code, your memory error and your question.
You seem to be a troll. True ?

Welcome aboard.
For which Spectrum ? 16k or 48k...
In your exemple:
Use an array from t$.Example:
FOR e = 1 to 64 STEP 2
READ t,t$
DATA 1,"RAIDERS",2,"BRONCOS",3,"CHIEFS",4,"CHARGERS" etc.
INPUT "How many games?";g
INPUT "Home Team";h
INPUT "Road Team";r
It will be nice to get memory room in the DATA.
DIM t$(32)
FOR e = 1 to 64 STEP 2: REM 65 ???
READ t$((e+1)/2)
DATA RAIDERS,BRONCOS,CHIEFS,CHARGERS
Don't understand your code, your memory error and your question.
You seem to be a troll. True ?

Last edited by XavSnap on Sat Apr 12, 2025 9:28 pm, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
- 1024MAK
- Posts: 5526
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: Updating NFL League Tables
This is likely to be related to him developing his program. He has a topic that may be related on another forum: Memory Issues.
Mark
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
Re: Updating NFL League Tables
Have a look to this thread: viewtopic.php?f=5&t=5067
In case of DATA, you had to create an array for all lookup index data, and reduce its lenght.
And read the indexed string:
Pickup a random team:
Where retteam=a random team (myindex value).
In case of DATA, you had to create an array for all lookup index data, and reduce its lenght.
And read the indexed string:
Code: Select all
LET myindex=16: display team 16
LET maxindex=32
FOR T=1 TO maxindex
READ T$
IF T<>myindex THEN NEXT T
PRINT "TEAM INDEX";myindex;"=";T$
Pickup a random team:
Code: Select all
LET arraylen=32
DIM lookup(arraylen)
REM INIT DATA TABLE
FOR T=1 TO arraylen
LERT lookup(T)=T
NEXT T
LET Maxindex=32
REM
Code: Select all
IF Maxindex=0 THEN PRINT "OUT of Team":RETURN
LET teamselect=INT(RND*maxindex)+1
REM
LET retteam=lookup(teamselect)
LET lookup(teamselect)=lookup(Maxindex)
LET maxindex=maxindex-1
RETURN
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: Updating NFL League Tables
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: Updating NFL League Tables
Thanks Mark,
Probably a lazy student's work, which Mark has already corrected. No code from the author, and off-topic answers...
Game over for me.
Probably a lazy student's work, which Mark has already corrected. No code from the author, and off-topic answers...
Game over for me.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: Updating NFL League Tables
Anyway..... how can I do this better?
R$ = road team
H$ = home team
SC = road team score
SCB = home team score
IF R$(BB) = "RAIDERS " AND SCB>SC OR H$(AA) = "RAIDERS " AND SC>SCB THEN LET RAW =RAW +1
IF R$(BB) = "RAIDERS " AND SC>SCB OR H$(AA) = "RAIDERS " AND SCB>SC THEN LET RAL =RAL +1
144kneo
R$ = road team
H$ = home team
SC = road team score
SCB = home team score
IF R$(BB) = "RAIDERS " AND SCB>SC OR H$(AA) = "RAIDERS " AND SC>SCB THEN LET RAW =RAW +1
IF R$(BB) = "RAIDERS " AND SC>SCB OR H$(AA) = "RAIDERS " AND SCB>SC THEN LET RAL =RAL +1
144kneo