The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Anything QL Software or Programming Related.
User avatar
TMD2003
Trump Card
Posts: 172
Joined: Sat Oct 10, 2020 12:18 pm

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by TMD2003 »

CALLING ALL EXPERT QL PROGRAMMERS!

I have a Crap Game Challenge specifically for you! And it'll be quite un-Crap if any of you can pull it off.

Today, Jamie Bradbury has sent me Zoggle, a completely reworked version of his Z88 Boggle from earlier in the year. What it does do is display a grid of 16 letters chosen from a bank of 96 (although it should do so in groups of six, it appears... not to). What is does not do is play Boggle - it's left to the two human players to do that with a pen and paper.

Jamie does say in the accompanying README.md file (which comes straight from GitLab - no idea what the .md extension is all about) that he does intend to make it possible to play human-versus-Z88... but it's going to involve a huge word list. Think of all the words that could be theoretically possible from the pool of letters available - some of which are 17 letters long if the combined "Qu" is showing - and that's going to take an equally huge amount of memory to store.

And that's where I thought the QL could come in. This is a machine not limited to a piddling 128K, after all. Displaying the game grid could be done in 16 pre-defined windows, scrambling the dice and loading them into the grid seems to me like a simple bit of array manipulation... but the algorithms to actually get the computer to scan through the letter cubes that are available, the way a human player would, and assess if the combination matches any word in the bank... that's a bit more of a tricky proposition.

Is there someone here who'd be up to the challenge? Or could it be a joint effort? If so, stand up and be counted!


EDIT: look at the time of this post. It's now just short of 1 am and I've already made the skeleton of a Boggle game, at least the bit that throws the dice. Most of that time was spent setting up the screen rather than getting the arrays to work. This bit is really easy - I've done it in an hour. Now, somewhere out there, there's a published list of Boggle-appropriate words, which a quick internet search might well reveal. Mush!


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
XorA
Site Admin
Posts: 1629
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by XorA »

(which comes straight from GitLab - no idea what the .md extension is all about)
Its a Markdown file.


Derek_Stewart
Font of All Knowledge
Posts: 4684
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by Derek_Stewart »

Hi,

I have looked at the Zoggle files, which has been written using Z88DK.

This uses CONIO for it the terminal controls, which is a Turbo C, specific C Library, susual used on MSDOS computers.

I have looked for a Linux version of CONIO, but there seems to nothing avaialble.

I say Linux C library, as QLs C68 C compiler is closer to to Linux C code.

Maybe worth rewritting the code in Superbasic, which I will give a try, in the absence of a suitable CONIO replacement,


Regards,

Derek
swensont
Forum Moderator
Posts: 325
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by swensont »

The wiki page for conio.h (https://en.wikipedia.org/wiki/Conio.h) talks a little about it and mentions curses. If conio could be converted to curses, then it can be compiled for the QL. Graham (XorA) has recently fixed some bug in QL Curses and it should be more stable.

Tim


User avatar
tofro
Font of All Knowledge
Posts: 3097
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by tofro »

The following should get someone started:

Code: Select all


#include <stdio_h>
#include <qdos_h>

int kbhit(void) {
   /* Determines if a keyboard key was pressed */
   return (io_pend (fgetchid(stdin)) == 0);
}

char *cgets (char* buf) {
   /* Reads a string directly from the console */
   int buflen;
   char *buffer;
   
   buflen = buf [0];
   buffer = &(buf[2]);
   
   buf [1] = (char)io_fstrg (fgetchid (stdin), -1, buffer, buflen);
   return buffer;
}

int cscanf (const char *format, char *buffer, const char * ...) {
   /* Reads formatted values directly from the console */
   /* NI */
}

void putch (char ch) {
   /* Writes a character directly to the console */
   io_sbyte (fgetchid (stdout), -1, ch);
}

void cputs (char *str) {
   /* Writes a string directly to the console */
   io_sstrg (fgetchid (stdout), -1, str, strlen (str));
}
   
#define cprintf	printf
/* Formats values and writes them directly to the console */

void clrscr (void) {
   /* Clears the screen */
   sd_clear (fgetchid (stdout), -1);
}

int getch(void) {
   /* Get char entry from the console */
   return io_fbyte (fgetchid(stdout, -1);
}


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Andrew
QL Wafer Drive
Posts: 1033
Joined: Tue Jul 17, 2018 9:10 pm

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by Andrew »

TMD2003 wrote: Now, somewhere out there, there's a published list of Boggle-appropriate words, which a quick internet search might well reveal. Mush!
I found a list - it's just 1.6Mb. I guess it's a bit large for the QL. Maybe Q68 could cope with the list.


Derek_Stewart
Font of All Knowledge
Posts: 4684
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by Derek_Stewart »

Hi,

Amore complete version of a CONIO.H include file can be seen at:

https://github.com/zoelabbb/conio.h

Which a good idea to define the "conio.h" library functions as C functions.

Maybe worth developing a little more to work with C68.


Regards,

Derek
FrancoisLanciault
Trump Card
Posts: 177
Joined: Mon Aug 08, 2011 11:08 pm

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by FrancoisLanciault »

TMD2003 wrote:
but the algorithms to actually get the computer to scan through the letter cubes that are available, the way a human player would, and assess if the combination matches any word in the bank... that's a bit more of a tricky proposition.
Been there done that a the QL a long time ago (around 2004 if I recall). The program would ask you for a grid of letters and, looking into a plain text word dictionary, would find all possible words in the grid and output the result sorted by length. I did that at the time in order to cheat in online Boogle games ! I can pull out the source if you want.


User avatar
tofro
Font of All Knowledge
Posts: 3097
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by tofro »

FrancoisLanciault wrote: The program would ask you for a grid of letters and, looking into a plain text word dictionary, would find all possible words in the grid and output the result sorted by length. I did that at the time in order to cheat in online Boogle games ! I can pull out the source if you want.
"Plain text word dictionary" - bah! Real QLers use the spell device ;)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
TMD2003
Trump Card
Posts: 172
Joined: Sat Oct 10, 2020 12:18 pm

Re: The comp.sys.sinclair Crap Games Competition 2021: 25th edition extravaganza!

Post by TMD2003 »

It's odd, isn't it. It took me an hour to make a Boggle grid for the QL, and all I'd need to do was add a title and a method of keeping score and I'd have a QL equivalent of both of Jamie's games and a Spectrum type-in from way after type-ins were still a major concern.

The process of throwing the dice was so easy that I thought I could do it on a ZX80, and I'd already started making a routine to shuffle the alphabet. A tweak here, a cut-down to 16 characters there, and... why won't it work? I went searching through a ROM disassmebly to find out his its RND function worked, and about three hours just trying to get it to loop more than once. And because of the way it has to be input, ZX80 machine code is a bit like trying to do a Rubik's Cube blindfolded. An assembler! An assembler! My kingdom for an assembler!

Some people out there still think SuperBASIC is beyond them. I've picked up enough of it in the last year to see me through for a long time.
FrancoisLanciault wrote:Been there done that a the QL a long time ago (around 2004 if I recall). The program would ask you for a grid of letters and, looking into a plain text word dictionary, would find all possible words in the grid and output the result sorted by length. I did that at the time in order to cheat in online Boogle games ! I can pull out the source if you want.
Really, all you have to do now is generate a scrambled grid, and you're there.

Take a look at the C code in the Zoggle link - Jamie assures me that he took the letter distribution from a real, physical set of Boggle dice, and although it's given as a string of 96 consecutive letters, each group of six is one of the dice.
Andrew wrote:I found a list - it's just 1.6Mb. I guess it's a bit large for the QL. Maybe Q68 could cope with the list.
Well, QemuLator can handle 4 MB of memory, and QPC2 goes up to 255 MB...

...I dread to think what the loading time from a microdrive would be like (if there could ever be one that size) - and don't get me started on a tape!


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Post Reply