Jotto

General games-related topics
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Jotto

Post by Moggy »

There is a facility in Eighty One to do this by dragging and dropping the text file into the display area of Eighty One but it reports your file as being to large to parse and your dimension statement looks too big as it reports out of memory with just 100 lines of code when run even with a 48k RAM chosen from the menu.

For example here are the first 100 lines of your program.
Attachments
test.p
(2.67 KiB) Downloaded 88 times
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Jotto

Post by XavSnap »

:lol:

Just ask "ENTER THE FIRST LETTER OF THE WORD WHAT I HAD TO GUESS:"
INPUT A$
LOAD A$

26x16kb= 416kb !

Just ask "ENTER THE SECOND LETTER OF THE WORD WHAT I HAD TO GUESS:"
Avoid to waste time.
:lol: :lol: :lol:

And you had to erase all lines and type a GOTO to keep string values.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Jotto

Post by 1024MAK »

To use the maximum RAM for BASIC when using more than 16K bytes, you need to do:

Code: Select all

POKE 16388,255
POKE 16389,255
NEW 
The above values assume you have RAM all the way up to 65535 (48K or 64K of RAM).

The above POKEs and NEW puts the system variable (called RAMTOP) to point to the very top of the Z80’s memory range.

Only then enter your code.

However, just dimensioning the array alone will use up more than 44K bytes of RAM…

I think you need to use a ZX Spectrum 128, +2 or +3, or maybe a QL for this idea… Even then, with the 128K versions of the Spectrum, you will need to use some trickery with the bank switching of RAM…

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
salvacam
Posts: 50
Joined: Wed Jul 21, 2021 4:50 pm

Re: Jotto

Post by salvacam »

sanello wrote: Tue Aug 16, 2022 3:58 am I know this is completely ridiculous, but humor me. Can this txt file be converted to a .p file?

words.txt
You can use http://freestuff.grok.co.uk/zxtext2p/
But your program shows the error "program too big!"
My games

ZX81 hoy Blog (in Spanish) of new games and applications for the ZX81
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Jotto

Post by XavSnap »

Hi Mark & alvacam ,

The big text file can be compress to 28kb (PuCrunch and Zx7) in a single REM.
But, we had to stream all words to compare them to user choice.

The better way to "compress" it is to encode them in letters groups..
A byte for the first group "xxx" and a byte for the last group "xx" (256 ID per group = 65536 words in 512 bytes +"aaa"*? +"aa"*?)
In 10kb, around 5000 word + 2kb for the matrix string + 4 Kb for BASIC/ASM decoding...
A 16 kb RAM PACK can do that... but we had to encode the words array.
:oops:

Better code multigame to validate the word... like a classic hangman.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Re: Jotto

Post by sanello »

While you are thinking about the ridiculous size, I loaded the new 9000+ word version on my IBM XT. While the computer was sorting out it's first guess, I went to bed. It wasn't done when i woke up, but it finally had it worked out after I got my coffee, showered and got dressed. It's 9:30 pm here now and we're now on turn 3. So exhilarating!
-sanello
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Jotto

Post by XavSnap »

Hi Sanello,

Don't read all words in the file with INPUT# or LINE INPUT#...
All your words have a fixe length (5 characters).
You should use the Random Access File process.
You had to pick up all lines and write it in a fixe dedicated file.
It will avoid reading lines to get the word ID, you will be able to target a randomized word ID)

http://www.antonis.de/qbebooks/gwbasman ... r%205.html
40 GET #1, CODE%
50 PRINT N$
Where CODE% is the word ID, it GET the cluster and set the field targeted by a (RND*9000)+1

Write;

Code: Select all

5 Test$="ABCDE"
6 CODE%=1
10 OPEN "R",#1,"INFOFILE",32
20 FIELD #1, 5 AS N$
25  LSET N$=Test$
30  PUT #1, CODE%
60 CLOSE #1
Read:

Code: Select all

6 CODE%=1
10 OPEN "R",#1,"INFOFILE",32
20 FIELD #1, 5 AS N$
40 GET #1, CODE%
50 PRINT N$; " IS your word."
60 CLOSE #1
But you had to convert the text file in a "A" to "R" setup and open both files to read and write data.

|EDIT
While the converting process, print the ID for the first A, the first B ...
It will be helpful to only check a character from A to B, if the A character is check.
Or stop the scan if the CHR$ value is up to the checked value.
If "U"=1200 and "V"=1300, scan the ID between 1200 & 1300.
Store these values in a text file with 26 values (A=first value...)
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply