Page 1 of 1

Is this a typo?

Posted: Thu Mar 20, 2025 11:42 pm
by fitz301
I trying to enter this program from a book by Tim Hartnell, but have come across an interesting problem. As you can see there's 2 - line 2's?!

Is this a typo?
book_page.jpg

Re: Is this a typo?

Posted: Fri Mar 21, 2025 12:21 am
by XavSnap

Re: Is this a typo?

Posted: Fri Mar 21, 2025 5:22 am
by fitz301
So how do I go about entering this into my zx?

I know how to get the line 0, but how do I get the 2 line 2's?

Re: Is this a typo?

Posted: Fri Mar 21, 2025 6:46 am
by XavSnap
Hi,
You can't enter lines without poking the line data index.

You had to renum the type-ins lines or move extra lines:

Code: Select all

1 REM BLACKJACK
2 GOSUB 7999
3 LET B$="..."

7999 LET BET=100
8000 ...

9998 SAVE "BLACKJACK"
9999 RUN
Then Line 2 is protected from the LIST/EDIT command.
"LIST 2" will point to the first LET line.

Re: Is this a typo?

Posted: Fri Mar 21, 2025 7:30 am
by XavSnap
I dryed to type it...
A RUN save the program, but stop after the "LET BET=100" command. (0/2)!
The gosub line can't be deleted, edited or launched.

It's a bug? :ugeek: No...

Just move extra lines to the proper location, and the game will init the Variables.

The program can't launch the initialization routine.
TWOTWO.P
(978 Bytes) Downloaded 24 times
Before RUN, type "2 GOSUB 8000"
In fact, the GOSUB line is use to set all fixed variables (A$= card face) to set the VARS memory segment for the first launch.


RUN
BREAK (space)
DELETE 8000-9000
2 LET BET=100
GOTO 1 (to save the program and the variables memory room)

You had to delete all lines beatween 8000 to 9000 to free memory room.
But a RUN will clear the A$ values, and A$ will be lost.

The init process 8000 to 9000 is slow, and can be execute once.

This is why the author chose not to run this part of the program each time.