John Conway: Game Over

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 2688
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: John Conway: Game Over

Post by tofro »

tcat wrote: Prospero Pascal, just curious how it compares to C1 Pascal, the one I have. C1 can run on plain QL, but have not tried yet, just read the manual.
PP is probably the most professional Pascal compiler for the QL (runs on both QL and SMSQ/E). While C1 compiles into P-Code, PP creates full-blown machine code programs. The extensions to Pascal that PP provides are relatively close to TurboPascal, so definitively a recommendation. What's impressive is its LONGREAL type (64-bit REAL) the best floating point Pascal for the QL.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
Font of All Knowledge
Posts: 2688
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: John Conway: Game Over

Post by tofro »

swensont wrote:Tofro,

Nice job on the Pascal, esp. in just an hour. I'm very rusty with my Pascal. I like how you did the key input since the screen is SCR and not CON.

Tim
Hi Tim,

actually, all windows opened by Prospero Pascal using WOpen are CON_soles.

What PP is missing in its library, is a no-echo, non-blocking keyboard query routine (Like Turbo Pascal's "KeyPressed" function). But that's easily amended using QDOS traps.

The ConSilent function in PP actually waits for a key press, which is not useful if you want the Game of Life generations pass by but still have the option to interrupt the simulation with a key press.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: John Conway: Game Over

Post by swensont »

Tofro,

> actually, all windows opened by Prospero Pascal using WOpen are CON_soles.

Page II-74 of the Pascal manual says:

"associates the Pascal file variable w with the QL console driver device SCR_......... (which is in fact the default SCR_ device)."

I read that to mean that when opening with Wopen, all you get is a SCR device (output only) and not a CON device (input/output). IIRC, I had the same issue with Pro Fortran.

Tim


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

Re: John Conway: Game Over

Post by tofro »

swensont wrote:Tofro,

> actually, all windows opened by Prospero Pascal using WOpen are CON_soles.

Page II-74 of the Pascal manual says:

"associates the Pascal file variable w with the QL console driver device SCR_......... (which is in fact the default SCR_ device)."

I read that to mean that when opening with Wopen, all you get is a SCR device (output only) and not a CON device (input/output). IIRC, I had the same issue with Pro Fortran.

Tim
Tim,
I think the manual is wrong or at least misleading. Checking the opened channels with QPAC2 Channels shows they're all CON_ channels.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: John Conway: Game Over

Post by polka »

Hi all !
My personnal hommage to Conway''s game of life

Image
and a link to my SuperForth code published here :
https://www.qlforum.co.uk/viewtopic.php ... 1330#p1330

May the FORTH be with John, forever !

POLKa


May the FORTH be with you !
POLKa
Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: John Conway: Game Over

Post by Derek_Stewart »

Hi,

Excellent programme, I have dabbled a little in Forth, but not much.

I had a laptop running ForthOS, which ran nicely on a 486 CPU.

I quite like Superforth, I should spend more time with it.

I will open s new thread about Forth.


Regards,

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

Re: John Conway: Game Over

Post by swensont »

Tofro,

I've got around to trying to use WOPEN to create a console window (wopen(con1,512,256,0,0). I used it at the start of my program and all input and output is using con1. The first time I compiled and ran, I got "Error F - no reset". So I added a reset to con1 and then I got "Error D - Illegal for SCR - SCR_512x256a0x0". I am using read() and readln(). It's looking like the manual is correct that wopen is only for SCR (output only) windows.

Tim Swenson


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

Re: John Conway: Game Over

Post by tofro »

Tim,

I just checked again:

Obviously, I was mis-led by the QPAC2 "Channels" app : This lists all screen channels as "CON_soles", even if they are "SCR_eens" only.

Sorry for the confusion.

If you want a CON_sole, you can easily use

Code: Select all

Assign (StatusBar, 'con_180x204a42x30');
Rewrite (StatusBar);
instead of WOpen

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: John Conway: Game Over

Post by mk79 »

tofro wrote:Obviously, I was mis-led by the QPAC2 "Channels" app : This lists all screen channels as "CON_soles", even if they are "SCR_eens" only.
Oh right. The code to determine channel names is pretty dirty, but if I ever release another QPAC2 this will be fixed ;)

Cheers, Marcel


Post Reply