Page 1 of 1

Updating NFL League Tables

Posted: Sat Apr 12, 2025 1:48 pm
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

Re: Updating NFL League Tables

Posted: Sat Apr 12, 2025 3:09 pm
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:

Re: Updating NFL League Tables

Posted: Sat Apr 12, 2025 3:33 pm
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

Re: Updating NFL League Tables

Posted: Sat Apr 12, 2025 3:54 pm
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).

Re: Updating NFL League Tables

Posted: Sat Apr 12, 2025 3:59 pm
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:

Re: Updating NFL League Tables

Posted: Sat Apr 12, 2025 4:25 pm
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.

Re: Updating NFL League Tables

Posted: Sun Apr 20, 2025 5:09 pm
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