John Conway: Game Over

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

Re: John Conway: Game Over

Postby tofro » Thu Apr 16, 2020 8:32 am

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: 2229
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: John Conway: Game Over

Postby tofro » Thu Apr 16, 2020 12:28 pm

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: 220
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: John Conway: Game Over

Postby swensont » Fri Apr 17, 2020 12:55 am

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: 2229
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: John Conway: Game Over

Postby tofro » Fri Apr 17, 2020 7:42 am

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: 173
Joined: Mon Mar 07, 2011 11:43 am

Re: John Conway: Game Over

Postby polka » Sat Apr 18, 2020 7:19 pm

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: 2571
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: John Conway: Game Over

Postby Derek_Stewart » Sat Apr 18, 2020 8:01 pm

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: 220
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: John Conway: Game Over

Postby swensont » Mon May 04, 2020 3:50 am

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: 2229
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: John Conway: Game Over

Postby tofro » Mon May 04, 2020 8:23 am

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: 1137
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: John Conway: Game Over

Postby mk79 » Tue May 05, 2020 11:05 am

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



Who is online

Users browsing this forum: No registered users and 6 guests