Tapestry graphics demo (BBC BASIC)

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
lurkio
Posts: 2177
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Tapestry graphics demo (BBC BASIC)

Post by lurkio » Mon Apr 29, 2019 9:32 pm

Bit of an odd one, this. It's from the July 1983 issue of Which Micro? And Software Review magazine, and it's titled "BBC B Tapestry" but it only works in Shadow MODE 130 on a Master. If you try to run it in MODE 2 on a Model B, as per the article, you get a "DIM space at line 30" error.
BBC B Tapestry

At the beginning the program prompts for the number of seeds. If you choose one seed it is placed in the centre of the screen. Multiples of four seeds are positioned regularly around two axes, other even numbers are positioned regularly around one axis. Odd numbers of seeds are scattered randomly in a central area of the screen.

After pressing 'Return' the growth begins immediately. The sequence and number of colours is chosen randomly by the computer. The pattern will stop when it reaches the edge of the screen.

Code: Select all

 10 MODE130
 20 G%=420
 30 DIM A%(G%),B%(G%),C%(G%),D%(G%),U%(15)
 40 *FX9,255
 50 *FX10,255
 60 PRINTTAB(0,5)"SPACE BAR -":PRINT
 70 PRINT"STOP AND START"
 80 PRINTTAB(0,12)"'E' - END"
 90 INPUTTAB(0,20)"NUMBER OF SEEDS",O%
100 VDU23,0,10,32,0;0;0;
110 K%=RND(15)
120 FORN%=1TOK%
130  U%(N%)=RND(15)
140 NEXT
150 J%=8:ST%=0:P1%=0:P2%=0:P3%=0
160 CLG
170 VDU29,640;512;
180 GCOL0,U%(K%)
190 E%=0
200 IFO%=1THENPROCSQ(0,0):PROCPATTERN
210 IFO% MOD4=0THENPROCFOUR
220 IFO% MOD2=0THENPROCEVEN
230 FORN%=1TOO%
240  P%=FNRAND:Q%=FNRAND
250  PROCSQ(P%,Q%)
260 NEXT
270 PROCPATTERN
280 END
290 DEFPROCFOUR
300 O%=O%/4
310 FORN%=1TOO%
320  P%=FNRAND:Q%=FNRAND
330  PROCSQ(P%,Q%)
340  PROCSQ(-P%,-Q%)
350  PROCSQ(-P%,Q%)
360  PROCSQ(P%,-Q%)
370 NEXT
380 PROCPATTERN
390 ENDPROC
400 DEFPROCEVEN
410 O%=O%/2
420 FORN%=1TOO%
430  P%=FNRAND:Q%=FNRAND
440  PROCSQ(P%,Q%)
450  PROCSQ(-P%,-Q%)
460 NEXT
470 PROCPATTERN
480 ENDPROC
490 DEFPROCPATTERN
500  REPEAT
510   FORC%=1TOK%
520    GCOL0,U%(C%)
530    FORF%=1TOE%:A%(F%)=C%(F%):B%(F%)=D%(F%):NEXT
540    L%=E%:E%=0
550    FORN%=1TOL%
560     X%=A%(N%):Y%=B%(N%)
570     P%=X%+J%:Q%=Y%+J%
580     P1%=POINT(P%-J%,Q%+J%):P2%=POINT(P%+J%,Q%+J%):P3%=POINT(P%+J%,Q%-J%)
590     PROCSQ(P%,Q%)
600     P%=X%+J%:Q%=Y%-J%
610     P1%=POINT(P%+J%,Q%-J%):P2%=POINT(P%+J%,Q%+J%):P3%=POINT(P%-J%,Q%-J%)
620     PROCSQ(P%,Q%)
630     P%=X%-J%:Q%=Y%-J%
640     P1%=POINT(P%-J%,Q%-J%):P2%=POINT(P%+J%,Q%-J%):P3%=POINT(P%-J%,Q%+J%)
650     PROCSQ(P%,Q%)
660     P%=X%-J%:Q%=Y%+J%
670     P1%=POINT(P%-J%,Q%+J%):P2%=POINT(P%+J%,Q%+J%):P3%=POINT(P%-J%,Q%-J%)
680     PROCSQ(P%,Q%)
690    NEXT
700    IFST%=1ORINKEY(0)=32THENW%=GET:IFW%=69THENCLS:GOTO60
710   NEXT
720  UNTILFALSE
730 ENDPROC
740 DEFPROCSQ(P%,Q%)
750  IFP1%+P2%+P3%>0GOTO800
760  IFP1%=-1ORP2%=-1ORP3%=-1 ST%=1
770  VDU25,4,P%+J%;Q%;:VDU25,4,P%;Q%+J%;:VDU25,85,P%;Q%-J%;:VDU25,85,P%-J%;Q%;
780  E%=E%+1:IFE%>G% THENE%=G%
790  C%(E%)=P%:D%(E%)=Q%
800 ENDPROC
810 DEFFNRAND=INT((200-RND(400))/(2*J%))*2*J%
Run the program in Master mode in JSBeeb:
:idea:
Last edited by lurkio on Mon Apr 29, 2019 10:58 pm, edited 1 time in total.

User avatar
billcarr2005
Posts: 1390
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: Tapestry graphics demo (BBC BASIC)

Post by billcarr2005 » Tue Apr 30, 2019 6:10 am

Perhaps it was expecting to run on a tape only BBC, with page at &E00? :roll:

User avatar
lurkio
Posts: 2177
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Tapestry graphics demo (BBC BASIC)

Post by lurkio » Tue Apr 30, 2019 8:26 am

billcarr2005 wrote:
Tue Apr 30, 2019 6:10 am
Perhaps it was expecting to run on a tape only BBC, with page at &E00? :roll:
#-o :oops:

User avatar
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Tapestry graphics demo (BBC BASIC)

Post by AndyF » Thu May 02, 2019 9:04 am

Its quite interesting :) :)

Best I found to set a lowish number of seeds, say 2 to 8. Setting a high number makes an interesting symmetry type pattern though:

100 Seeds - Yes I know, sorry)
100s.png
100s.png (5.82 KiB) Viewed 534 times
5 Seeds - After a few seconds running
5s_1.png
5s_1.png (3.27 KiB) Viewed 534 times
5 Seeds - After a couple of minutes running
5s_2.png
5s_2.png (9.4 KiB) Viewed 534 times
=D>
Last edited by AndyF on Thu May 02, 2019 9:07 am, edited 1 time in total.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
lurkio
Posts: 2177
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Tapestry graphics demo (BBC BASIC)

Post by lurkio » Thu May 02, 2019 5:31 pm

AndyF wrote:
Thu May 02, 2019 9:04 am
Its quite interesting
Thanks for the screenshots!

:)

User avatar
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Tapestry graphics demo (BBC BASIC)

Post by AndyF » Sun May 05, 2019 6:44 am

lurkio wrote:
Thu May 02, 2019 5:31 pm
Thanks for the screenshots!

:)
Most welcome. Just a few more then that's it. :)

Firstly set at 25 seeds:
tap25.png
tap25.png (11.82 KiB) Viewed 436 times
Secondly and more interestingly, a three part multi-pic of three seeds 'growing' as such:
tap_three_growing.png
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

Post Reply