Updating NFL League Tables

Post Reply
144kneo
Posts: 3
Joined: Sat Apr 12, 2025 12:51 pm

Updating NFL League Tables

Post by 144kneo »

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
Last edited by 144kneo on Sat Apr 12, 2025 11:02 pm, edited 1 time in total.
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Updating NFL League Tables

Post by XavSnap »

Hi 144kNeo,
Welcome aboard.

For which Spectrum ? 16k or 48k...

In your exemple:
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
Use an array from t$.
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 ?
:oops:
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)
User avatar
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

Post by 1024MAK »

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
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...
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Updating NFL League Tables

Post by XavSnap »

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:

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
Where retteam=a random team (myindex value).
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Updating NFL League Tables

Post by XavSnap »

Code: Select all

 LET E$=U$,G$=V$,J$=W$,N$=A$,PAPA=P,BORA=BOR,R$=O$
NOT ON A SPECTRUM BASIC !
:oops:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Updating NFL League Tables

Post by XavSnap »

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.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
144kneo
Posts: 3
Joined: Sat Apr 12, 2025 12:51 pm

Re: Updating NFL League Tables

Post by 144kneo »

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
Post Reply