Any short type-ins for unattended Beebs?

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Sat Apr 06, 2019 4: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 3:30 pm

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

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

Preview combi-pics:
solid.png
solid.png (1.74 KiB) Viewed 524 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 3: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 12: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: 2615
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 12:02 pm

That's great!

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Tue May 14, 2019 1: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: 2177
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Wed May 15, 2019 11:40 pm

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 12:42 am, edited 2 times in total.

Post Reply