Author Topic: Locomotive BASIC - The Game Of Life.  (Read 712 times)

0 Members and 1 Guest are viewing this topic.

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.115
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 2280
  • Likes Given: 4521
Locomotive BASIC - The Game Of Life.
« on: 15:37, 03 March 21 »
Conway's Game of Life - CPC  version from Amstrad Computer User issue 12, November 1985.
Now I've "cheated" here a little by starting the video just as I'm finishing off the last of the cell patterns but that is just to shorten the video length.
Program is Listed at the end of the video.


https://www.youtube.com/watch?v=6PBRQnDod1Y

ACU article and Listing here:
https://archive.org/details/AmstradComputerUser12-1185/page/n87/mode/1up

Other links:

https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

https://www.cpc-power.com/index.php?page=detail&num=11172


Related Wiki thread:

http://www.cpcwiki.eu/forum/programming/amstrifejohn-conways-game-of-life-for-the-cpcfast-many-features-on-the-way!

Not emulated - original hardware and software

Please note that  the aspect ratio for this YouTube video is 16:9 but the CPC monitor
has an aspect ratio of 4:3 so you may wish to adjust your viewing device accordingly.
« Last Edit: 16:13, 03 March 21 by ComSoft6128 »

Offline zhulien

  • 6128 Plus
  • ******
  • Posts: 650
  • Country: au
  • aka Vorax
    • 8bitology
  • Liked: 266
  • Likes Given: 260
Re: Locomotive BASIC - The Game Of Life.
« Reply #1 on: 02:34, 05 March 21 »
Does this version support all game of life standard behaviour allowing for repeaters, spaceships and blockers etc?

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.115
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 2280
  • Likes Given: 4521
Re: Locomotive BASIC - The Game Of Life.
« Reply #2 on: 08:55, 05 March 21 »
Hi @zhulien ,

Good question and having had a second (and third!) look at the program I would say not.........But as per the ACU article (above) some behaviour may not be observable:

"There are other famous patterns which cannot be completed on a screen the size of the Amstrad's but which have been explored on Other systems. One which does get off to a good start is the glider gun which shoots off gliders every so often but you only get one, or two if you’re lucky, on the Amstrad’s screen."

I ran one session of the program for a thousand generations (gave me time to get breakfast :) ) and then played back the recorded video.
Stable/static "colonies" formed at generation 120 with a few "blinkers" still on the screen and that's the way it stayed right thru to generation 1000.

Might be best if you had a look at it yourself and see what you find.

Cheers,


Peter







« Last Edit: 08:58, 05 March 21 by ComSoft6128 »

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.115
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 2280
  • Likes Given: 4521
Re: Locomotive BASIC - The Game Of Life.
« Reply #3 on: 16:47, 05 March 21 »
Ran across this 1992 demo will looking at Peter Sorensen's BASIC files, unfortunately its not BASIC but is worth having a look at.
With this one the colonies stabilised at 311 generations (4:54) and after running up to 1000 generations reset back to zero
with stabilisation occurring on the second run somewhere past 700 generations.

"This demo was send to Amstrad Action or Amstrad Computer User, don't remember which, and I don't think it was printed or put on a cover tape either."


https://www.youtube.com/watch?v=Ki_w1zWFvEY

Links:

https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

https://www.cpc-power.com/index.php?page=detail&num=15734

https://cpcrulez.fr/auteur-nwc.htm

https://www.cpcwiki.eu/index.php/NWC

http://memoryfull.net/articles.php?id=34

Not emulated - original hardware and software

Please note that  the aspect ratio for this YouTube video is 16:9 but the CPC monitor
has an aspect ratio of 4:3 so you may wish to adjust your viewing device accordingly.
« Last Edit: 16:56, 05 March 21 by ComSoft6128 »

Offline zhulien

  • 6128 Plus
  • ******
  • Posts: 650
  • Country: au
  • aka Vorax
    • 8bitology
  • Liked: 266
  • Likes Given: 260
Re: Locomotive BASIC - The Game Of Life.
« Reply #4 on: 18:40, 07 March 21 »
that is cool seeing it on a real cpc - makes me wonder if there are any game ideas that can incorporate these rules...


even if a platform game like mutant monty, having to go around arrange each pattern in sequence so that the overall master-plan of running a GOL simulator capable of running GOL

Offline SlartibartfastBB

  • CPC464
  • **
  • Posts: 5
  • Country: au
    • Ready? Z80
  • Liked: 12
  • Likes Given: 4
Re: Locomotive BASIC - The Game Of Life.
« Reply #5 on: 00:57, 08 March 21 »
Funny, two days ago I just wrote this program on assembly on the 6128.  I wasn't really happy with it as it was sooooo slow.  I'll check out the code for this one.  I am using buffering and read/writing directly to the screen using text calls.  I think I might move the data in memory and then copy it to the screen when I've done the next stage calculations.

Offline goksteroo

  • CPC464
  • **
  • Posts: 25
  • Country: au
  • Liked: 40
  • Likes Given: 1
Re: Locomotive BASIC - The Game Of Life.
« Reply #6 on: 02:45, 08 March 21 »
I did the same over 12 months ago when I re-started programming on the CPC after a 30 year absence - wrote it basic and then in assembly. I used 2 blocks of memory for calculations/results and then used the CPC's text rom calls for printing the screen. This was the slowest part of the program but I never bothered to change how this was done. One day maybe.... or maybe not - depends on any further lockdowns in Ozz.

Offline SRS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 640
  • Country: de
  • Schneider CPC464 - what else ?
  • Liked: 642
  • Likes Given: 372
Re: Locomotive BASIC - The Game Of Life.
« Reply #7 on: 20:31, 08 March 21 »
I liked this one a lot:
Code: [Select]
10 '********** GAME OF LIFE **********
20 '
30 '********** Basiclader fuer M-Code
40 MEMORY &7FFF
50 FOR adr=&8000 TO &8097
60 READ a$:a$="&"+a$:v=VAL(a$)
70 s=s+v:POKE adr,v
80 NEXT adr
90 IF s<>16737 THEN PRINT"DATAFEHLER !":END
100 '
110 DATA DD,21,EA,80,11,92,91,26
120 DATA A2,0E,32,06,50,DD,23,13
130 DATA DD,7E,AD,DD,86,AE,DD,86
140 DATA AF,DD,86,FF,DD,86,01,DD
150 DATA 86,51,DD,86,52,DD,86,53
160 DATA DD,CB,00,46,28,02,C6,09
170 DATA 6F,6E,7D,DD,AE,00,0F,B5
180 DATA 12,DD,23,13,10,D2,DD,23
190 DATA 13,0D,20,C7,21,92,91,11
200 DATA EA,80,01,04,10,ED,B0,21
210 DATA 00,E0,E5,26,C0,11,EA,80
220 DATA 0E,32,06,50,13,1A,CB,7F
230 DATA 28,15,E6,01,12,D5,E5,11
240 DATA 00,08,3E,0E,28,02,3E,E0
250 DATA 77,19,77,19,77,E1,D1,23
260 DATA 13,10,E2,E3,13,0D,20,DA
270 DATA E1,C9,3E,80,CD,8B,80,CD
280 DATA 4F,80,AF,21,98,80,54,5D
290 DATA 13,01,4F,21,77,ED,B0,C9
300 '
310 '********** Initialsierung
320 MODE 1
330 DEFINT a-z
340 INK 0,0:INK 1,13:INK 2,3:INK 3,24
350 BORDER 0
360 PLOT -2,-2,3
370 SYMBOL 250,&F8,&88,&88,&88,&F8,0,0,0
380 cu$=CHR$(250)
390 xon$=CHR$(23)+CHR$(1)
400 xoff$=CHR$(23)+CHR$(0)
410 feld=&8098:clrfeld=&8082:gen=&8000
420 t1$="EZLA "
430 t2$=CHR$(13)
440 FOR c=240 TO 243
450 t2$=t2$+CHR$(c)
460 NEXT
470 CALL clrfeld:REM Feld loeschen
480 '
490 '********** Regelkatalog einlesen
500 FOR adr=&A200 TO &A211
510 READ et:POKE adr,et
520 NEXT
530 DATA 0,0,0,1,0,0,0,0,0
540 DATA 0,0,1,1,0,0,0,0,0
550 '
560 '********** Tastaturabfrage
570 'E = Editor
580 'Z = Zufallsverteilung
590 'L = Spielfeld loeschen
600 'A = autom. Generationswechsel
610 '<SPACE> = naechste Gen. berechnen
620 '<ENTER> = Funktionen E,Z,A beenden
630 '
640 a$=UPPER$(INKEY$):IF a$="" THEN 640
650 ON INSTR(t1$,a$) GOTO 690,850,940,970,1030
660 GOTO 640
670 '
680 '********** Editor
690 PRINT xon$;
700 re=1:sp=1
710 TAG:MOVE 8*sp-10,408-8*re:PRINT cu$;
720 a$=INKEY$:IF a$="" THEN 720
730 MOVER -16,0:PRINT cu$;:TAGOFF
740 IF NOT INKEY(64) THEN f=1:GOSUB 1060
750 IF NOT INKEY(32) THEN f=0:GOSUB 1060
760 ON INSTR(t2$,a$) GOTO 640,790,800,810,820
770 GOTO 710
780 '
790 IF re>1 THEN re=re-1:GOTO 710 ELSE 710
800 IF re<50 THEN re=re+1:GOTO 710 ELSE 710
810 IF sp>1 THEN sp=sp-1:GOTO 710 ELSE 710
820 IF sp<80 THEN sp=sp+1:GOTO 710 ELSE 710
830 '
840 '********** Zufallsverteilung
850 f=1
860 WHILE INKEY$<>CHR$(13)
870 re=INT(RND*50)+1
880 sp=INT(RND*80)+1
890 GOSUB 1060
900 WEND
910 GOTO 640
920 '
930 '********** Spielfeld loeschen
940 CALL clrfeld:GOTO 640
950 '
960 '********* Autom. Generationswechel
970 WHILE INKEY$<>CHR$(13)
980 CALL gen
990 WEND
1000 GOTO 640
1010 '
1020 '********* Naechste Gen. berechnen
1030 CALL gen:GOTO 640
1040 '
1050 '****** SUB Zelle belegen/loeschen
1060 POKE feld+82*re+sp,f
1070 PRINT xoff$;
1080 IF f=1 THEN PLOT -2,-2,1 ELSE PLOT -2,-2,2
1090 FOR x=8*sp-8 TO 8*sp-4 STEP 2
1100 FOR y=402-8*re TO 406-8*re STEP 2
1110 PLOT x,y
1120 NEXT y,x
1130 PRINT xon$;:PLOT -2,-2,3
1140 RETURN

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 128
  • Likes Given: 154
Re: Locomotive BASIC - The Game Of Life.
« Reply #8 on: 07:25, 09 March 21 »
I liked this one a lot:

Me too, this is the version from "CPC Schneider International" Legend Matthias Uphoff:

https://www.michael-wessel.info/retro/CPC/SoftEx/SoftExKap02.htm
https://www.michael-wessel.info/retro/CPC/SoftEx/softex.dsk

(on the left in the picture, the other guy was the editor in chief of the CPCAI).
Anybody knows what Matthias is up to these days?
 
« Last Edit: 07:30, 09 March 21 by VintageAdvantage »

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.115
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 2280
  • Likes Given: 4521
Re: Locomotive BASIC - The Game Of Life.
« Reply #9 on: 19:51, 09 March 21 »
Another contender.......

From Computing With The Amstrad Vol 2 No 10
Please note that I take option 2 at 4:58 which radically changes the outcome.
Program is Listed at the end of the video.


https://www.youtube.com/watch?v=J5xQnZaYlrM

Links:

http://www.cpcwiki.eu/index.php/Computing_with_the_Amstrad

https://www.cpc-power.com/index.php?page=detail&num=15399