Any short type-ins for unattended Beebs?

bbc/electron apps, languages, utils, educational progs, demos + more
User avatar
lurkio
Posts: 2668
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Sat Apr 06, 2019 5:06 pm

The Persian rug program from the Beeb user guide:

Code: Select all

0MODE1:D%=4:VDU19,2,RND(3)+1,0,0,0,19,3,RND(3)+4,0,0,0,29,640;512;:J%=0:FORK%=400TO280STEP-40:REPEATA%=RND(3):UNTILA%<>J%:J%=A%:GCOL3,J%:FORI%=-K%TOK%STEPD%:MOVEK%,I%:DRAW-K%,-I%:MOVEI%,-K%:DRAW-I%,K%:NEXT,:TIME=0:REPEATUNTILTIME>500:RUN
Run in JSBeeb:
:idea:

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

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Thu Apr 11, 2019 4:30 pm

Some quite similar ( and shameful quality :oops: ) small randomness:
patterns.ssd
(3 KiB) Downloaded 20 times
Consists of:

Blocks / Characters / Bricks / Letters / Squares / Numbers / Solid

Preview combi-pics:
solid.png
solid.png (1.74 KiB) Viewed 1175 times
mixed.png
:oops:

I don't think there was a great deal of point in having a 'numbers' and 'letters' and 'characters' as separate files actually, oh well. Having said that I did try in Mode7 to have random text characters and teletext graphic blocks but despite my efforts it always added a space after, even when forcing a backspace I could not get it to behave properly. I must revisit that, hence why the above are all Mode2...
Last edited by AndyF on Thu Apr 11, 2019 4:32 pm, edited 2 times 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
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Fri Apr 12, 2019 1:16 pm

You know it might of been more sensible thinking about this (aside from just pressing BREAK and not saving the Basic!) to either of put them all into one piece of Basic where either one choice would be selected at random and then perhaps cycled every few minutes (so ti was completely unattended) or have a cheapy menu choice of which pattern/effect to use.

By the latter I don't mean a 'Menu' Basic which loaded the appropriate file, merely a choice in the single file itself. Anyway does not matter too much I guess.

Andy awaits other's new "short type-in's" in much anticipation! :D
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
BigEd
Posts: 3062
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Apr 13, 2019 1:02 pm

That's great!

User avatar
lurkio
Posts: 2668
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Tue May 14, 2019 2:10 pm

This is a bit of a long type-in (but it's a variation on an earlier theme in this thread):

Code: Select all

REM Set up a pseudo-array of integer values 0..1278
 10 MODE7:PRINTTAB(11,10)"Preparing... ";:C%=0:B%=0:O%=0:J%=0:A%=0:DIM S% 2558:FORI%=0TO1278:S%?(2*I%)=I%MOD256:S%?(2*I%+1)=I%DIV256:NEXT:VDU23;8202;0;0;0;
REM Shuffle the values to create a random order for later 
 20 FORI%=0TO1278:R%=RND(1279)-1:T%=(S%?(2*R%))+256*(S%?(2*R%+1)):S%?(2*R%)=S%?(2*I%):S%?(2*R%+1)=S%?(2*I%+1):S%?(2*I%)=T%MOD256:S%?(2*I%+1)=T%DIV256:PRINTTAB(24,10);1278-I%;"   ";:NEXT
REM "Screensaver" pattern begins
REM Define two colours and two UDG characters
 30 MODE1:VDU23;8202;0;0;0;19,3,2;0;0;0;19,2,6;0;0;0;23,128,1,2,4,8,16,32,64,128,23,129,128,64,32,16,8,4,2,1
REM Main loop
 40 REPEAT
REM Colour 3 to print pattern, colour 0 to erase
 50  C%=C%EOR1:IFC%=1COLOUR3ELSECOLOUR0
REM Fill in bottom-right corner "manually"
 60  IFC%=1ANDB%=0VDU31,39,31,127+RND(2),31,0,0,11
 70  B%=0
REM Count upwards when printing pattern
 80  IF C%=1 A%=J%:Z%=1278:P%=1
 REM Count down when erasing pattern
 90  IF C%=0 A%=1278:Z%=0:P%=-1
REM Loop to print (or erase) pattern
100  FORI%=A%TOZ%STEPP%
REM Calculate which value to pick from shuffled sequence
110   U%=(I%+O%)MOD1279
120   R%=(S%?(2*U%))+256*(S%?(2*U%+1))
REM Convert value to X,Y text-coordinates
130   Y%=R%DIV40:X%=R%MOD40
140   VDU31,X%,Y%
REM Sometimes switch colours when printing pattern
150   IFC%=1ANDRND(1280)>1100COLOUR2:VDU127+RND(2):COLOUR3ELSEVDU127+RND(2)
REM Sometimes erase part of pattern rather than entire pattern
160   IFC%=0ANDRND(1280)>1278J%=I%:I%=-1:B%=1
170  NEXT
REM If entire pattern has been erased, CLS to clear bottom-right
180  IFC%=0ANDB%=0J%=0:CLS:VDU19,3,RND(7);0;0;0;:TIME=0:REPEATUNTILTIME>100
REM When erasing, start at random point in shuffled sequence
190  IFC%=1O%=RND(1279)-1
REM Repeat indefinitely
200 UNTIL0

Run the program in JSBeeb:

The shuffle algorithm is a bit slow. Is there a quicker shuffle (or passable "fake" shuffle) I can use?

:?:

User avatar
lurkio
Posts: 2668
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Thu May 16, 2019 12:40 am

From the January 1984 issue of Computer Answers magazine, a program that generates the sound of what the article calls a "car engine", but it has echoes of Daredevil Dennis:

IMG_4348.png
Article

Code: Select all

 10 FORI%=1TO40
 20 SOUND&100,-15,3,2
 30 SOUND&101,-8,80,1
 40 NEXT
 50 SOUND0,-15,3,50
 60 FORI%=10TO150STEP10
 70 SOUND1,0,I%,1
 80 NEXT
 90 X%=50
100 REPEAT
110 A$=INKEY$(0)
120 IF A$="Z" THEN X%=X%-2
130 IF A$="X" THEN X%=X%+2
140 IF A$="G" THEN X%=X%-30
150 SOUND1,0,X%,1
160 SOUND0,-15,3,1
170 UNTILA$="S"

Run in JSBeeb:
:idea:
Last edited by lurkio on Thu May 16, 2019 1:42 am, edited 2 times in total.

User avatar
BigEd
Posts: 3062
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sun Oct 20, 2019 1:16 pm

I was at TNMoC (The National Museum of Computing, on the Bletchley Park campus) yesterday and managed to type in dv8's version of Valentin Alibillo's Pi Spigot program:
IMG_2110-pi-spigot-basic-tnmoc-albillo-2.JPG

User avatar
lurkio
Posts: 2668
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Tue Feb 11, 2020 11:11 am

Compacted version of a nice "Matrix rain" effect by @electron_greg:

Code: Select all

e=7:D=6:MO.2:F.X=0TO19:S=RND(3):C=RND(15):F.Y=0TO31-RND(2)S.S:C.C:V.31X,Y,RND(26)+64:C=C+1+15*(C=15):N.,:C=3:V.5:REP.V.19,D,4,0;0;19,e,6,0;0;:TI.=0:REP.U.TI.>6:V.19,C,0;0;:e=e+1+15*(e=15):D=D+1+15*(D=15):C=C+1+15*(C=15):U.0
http://bbcmicro.co.uk/jsbeeb/play.php?p ... 3AFD300DFF

:idea:

User avatar
BigEd
Posts: 3062
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Tue Feb 11, 2020 11:24 am

Love it!

User avatar
lurkio
Posts: 2668
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Tue Feb 11, 2020 7:50 pm

This one, from Katie Anderson, is kind of brilliant:

Code: Select all

10 MODE 1
20 N=1
30 DIM A(8)
40 FOR I=1 TO 8
50 FOR J=1 TO 8
60 A(J)=N
70 NEXT J
80 A(I)=255
90 N=N*2
100 VDU 23,96+I,A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8)
110 NEXT I
120 PRINT "abcdefghgfedcb";
130 GOTO 120

The whole @bbcmicrobot account is worth a look too.

:idea:

User avatar
BigEd
Posts: 3062
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Wed Feb 12, 2020 10:21 am

Some spectacular contributions there! And a twitter account which posts animated renderings from an emulator in response to code snippets is a great idea.

I think we need to preserve some of the best, in case this account (once again) gets deleted.

elkrepair
Posts: 38
Joined: Tue Nov 13, 2018 1:53 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by elkrepair » Thu Feb 13, 2020 7:00 pm

A ball of string from a 1984 Ian Graham book:

10 MODE1
20 VDU29,640;512;
30 GCOL0,2
40 MOVE0,0
50 FOR A=0 TO 315 STEP 0.1
60 DRAW 500*COS(A)*SIN(A*0.98),500*SIN(A)
70 NEXT
Elk rev 4 & Plus1
BBC B rev 7 & Cumana Disc Drive
BBC micro:bit
RaspberryPi B+ & 3B & Zero
Abit BP6

Post Reply

Return to “8-bit acorn software: other”