Any short type-ins for unattended Beebs?

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
AndyF
Posts: 1089
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Sun Jul 08, 2018 11:39 am

Although slightly off topic, I have linked this topic to the ZX/Spectrum forum too (and provided a Speccy example as well as a couple of bits from here) to see what the 'equivalent' is on said platform. :) Said topic 'over there' can be found here for the curious.

For me at least it will be interesting to compare or see what is done.

On topic I had an idea of printing random teletext graphic blocks at random locations on the screen ( simply PRINTTAB(RND etc etc ) , but it tended to add a space after each one, despite trying a backspace code. That may of been quite interesting to watch.
Last edited by AndyF on Sun Jul 08, 2018 11:44 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!

Soruk
Posts: 214
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Soruk » Thu Jul 12, 2018 4:24 pm

Wow. What a pleasant find. This is a nice suite of things to test my fork of Brandy BASIC (a BBC BASIC implementation) - and almost all of the pure BASIC examples work fine (the chaos one crashes the interpreter) - and even that one poking MODE 7 screen memory works after a small change (using &FFFF7C00 as the base screen memory address) on my development tree.

Edit: Fixed bug in PLOT routine. Thanks!
Last edited by Soruk on Fri Jul 13, 2018 10:28 am, edited 1 time in total.

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

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Fri Jul 20, 2018 4:29 pm

Great to see what's been posted so far.

Anyone have any more they wish to share ? =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!

colonel32
Posts: 55
Joined: Wed Jan 18, 2017 7:59 pm
Location: USA
Contact:

Re: Any short type-ins for unattended Beebs?

Post by colonel32 » Fri Jul 20, 2018 4:52 pm

AndyF wrote:
Fri Jul 20, 2018 4:29 pm
Anyone have any more they wish to share ? =D>
It would be interesting to see the speed difference for the PET "hat" with hidden line removal, between the Spectrum and BBC. I haven't had time to play yet.

colonel32
Posts: 55
Joined: Wed Jan 18, 2017 7:59 pm
Location: USA
Contact:

Re: Any short type-ins for unattended Beebs?

Post by colonel32 » Fri Jul 20, 2018 4:56 pm

So sorry, I've conflated two different type-in threads on two different Spectrum forums. This is the PET hat, from this thread:

Image

This one pleased me, because I vividly remember that ad from BITD :)
Last edited by colonel32 on Fri Jul 20, 2018 4:56 pm, edited 1 time in total.

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Jul 28, 2018 3:48 pm

You could very easily sell me a computer if you showed me a picture like that!

Thanks for the Speccy thread link @AndyF - if you could possibly post some screenshots to that thread to illustrate what people have done, that would be great for Acorn-centric spectators!

I wonder if any trig-happy coder would like to take a bash at a spherical helix? There's a video of a Commodore pen-plotter drawing one, but we don't know what machine or what code is behind it.
Sphere-helix-pen-plotter.png
Wolfram Alpha can show the effect here but it doesn't tell you how to do it - need both spherical trig and some minor perspective effect.
Image

Edit: link to pen-plotter thread.
Last edited by BigEd on Sat Jul 28, 2018 3:49 pm, edited 1 time in total.

User avatar
ctr
Posts: 182
Joined: Wed Jul 16, 2014 2:53 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by ctr » Sat Jul 28, 2018 6:08 pm

The perspective might not be quite right...

Code: Select all

   10REM ctr - spherical spiral 
   20MODE0
   30REM number of steps:
   40R%=2500
   50H%=R%/2
   60REM rotated towards viewer by:
   70R=-PI/4
   80U=COS(R):V=SIN(R)
   90PROCP(4,0)
  100FORI%=1TOR%
  110PROCP(5,I%)
  120NEXT
  130END
  140DEFPROCP(C%,S%)
  150T=PI*(S%-H%)/R%
  160C=COS(T)
  170X=COS(50*T)*C
  180Z=SIN(50*T)*C
  190Y=SIN(T)
  200W=Y*U+Z*V
  210Z=-Y*V+Z*U
  220Y=W
  230P=3500/(8-Z)
  240PLOTC%,640+X*P,512+Y*P
  250ENDPROC

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Sat Jul 28, 2018 6:40 pm

ctr wrote:
Sat Jul 28, 2018 6:08 pm
The perspective might not be quite right...
Not too shabby..!

=D> =D> =D>

EDIT: URLified:
:idea:
Last edited by lurkio on Sat Jul 28, 2018 6:43 pm, edited 1 time in total.

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Jul 28, 2018 6:44 pm

Bravo!!!

Andrew_Waite
Posts: 61
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Wed Aug 01, 2018 2:36 am

I wrote this program this evening, and I think it fits the bill. Eight physical colours on the screen at once in Mode 0.

Code: Select all


   10 MODE 0:FOR N%=0 TO 169:PRINT "THIS IS MODE 0 ";:NEXT
   20 REPEAT:*FX19
   30 VDU19,0,0;0;19,0,1;0;19,0,2;0;19,0,3;0;19,0,4;0;19,0,5;0;19,0,6;0;19,0,7;0;19,0,0;0;:UNTIL FALSE

EDIT :
And from the command line as well!

MODE 0:FOR N%=0 TO 169:PRINT "THIS IS MODE 0 ";:NEXT:REPEAT:A%=19:CALL&FFF4:VDU19,0,0;0;19,0,1;0;19,0,2;0;19,0,3;0;19,0,4;0;19,0,5;0;19,0,6;0;19,0,7;0;19,0,0;0;:UNTIL FALSE
Last edited by Andrew_Waite on Sat Oct 13, 2018 1:37 am, edited 4 times in total.

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

Re: Any short type-ins for unattended Beebs?

Post by billcarr2005 » Wed Aug 01, 2018 2:17 pm

Andrew_Waite wrote:
Wed Aug 01, 2018 2:36 am
I wrote this program this evening, and I think it fits the bill. Eight physical colours on the screen at once in Mode 0!

10 MODE 0:FOR N%=0 TO 169:PRINT "THIS IS MODE 0 ";:NEXT
20 REPEAT:*FX19
30 VDU19,0,0;0;19,0,1;0;19,0,2;0;19,0,3;0;19,0,4;0;19,0,5;0;19,0,6;0;19,0,7;0;19,0,0;0;:UNTIL FALSE
With the following change, the text colour is changed, background remaining black...

Code: Select all

   30 VDU19,0,0;0;19,1,1;0;19,1,2;0;19,1,3;0;19,1,4;0;19,1,5;0;19,1,6;0;19,1,7;0;19,0,0;0;:UNTIL FALSE
Last edited by billcarr2005 on Wed Aug 01, 2018 2:19 pm, edited 1 time in total.

User avatar
davidb
Posts: 2231
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by davidb » Wed Aug 01, 2018 2:27 pm

Pressing keys tends to make the colours shift, which is an interesting effect, but perhaps running a small piece of machine code to turn interrupts off before running the loop might be useful.

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Wed Aug 01, 2018 5:08 pm

Just had a chance to try it: nice and simple! On JSBeeb there's a gentle wavering to the colour bars, which for me is a win: it shows something is still happening.

(With a *FX16 the wavering goes away, so it will be something to do with ADC conversion interrupts.)

I see Caps Lock will make the yellow bar bigger: that means the 100Hz regular interrupt is doing a little more work, I think, in this case checking the keyboard.
ThisIsMode0.png
Last edited by BigEd on Wed Aug 01, 2018 5:13 pm, edited 1 time in total.

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Fri Aug 24, 2018 8:05 am

Acorn World is coming up at the CCH (same place and time as ABUG) so that might be a good place to find some unattended Beebs and type in some code.

This page collects simple fractals - any of these likely to fall to a one-liner, or a ten-liner type-in?
Image

User avatar
ctr
Posts: 182
Joined: Wed Jul 16, 2014 2:53 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by ctr » Sat Aug 25, 2018 12:25 am

I did a Hilbert curve but that was 31 lines of code, much of it fiddly.

So I did this instead. It's much simpler, but really slow. Possibly too slow to be of interest on a real beeb.

Code: Select all

   10REM ctr - dragon curve ifs
   20MODE0
   30VDU23,1,0;0;0;0;
   40S=1/SQR(2) 
   50A=S*COS(PI/4):B=S*SIN(PI/4)
   60C=S*COS(3*PI/4):D=S*SIN(3*PI/4)  
   70REPEAT
   80X=0:Y=0
   90IFRND(2)=1THENX=1
  100FORC%=1TO20
  110IFRND(2)=1THENZ=A*X-B*Y:Y=B*X+A*Y ELSEZ=C*X-D*Y+1:Y=D*X+C*Y
  120X=Z
  130NEXT
  140PLOT69,320+640*X,640-640*Y
  150UNTIL 0
What you really need is a beeb with some kind of Logo installed.

Edit: Changed line 140 so the dragon is the right way up!
Last edited by ctr on Sat Aug 25, 2018 12:31 am, edited 1 time in total.

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Aug 25, 2018 8:07 am

I got a sort of leggy starfish made of dots - is that right? It's not what I expected! I can't see that I made a typo.
Screen Shot 2018-08-25 at 09.04.03.png

User avatar
Rich Talbot-Watkins
Posts: 1365
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Rich Talbot-Watkins » Sat Aug 25, 2018 9:37 am

Yes: line 110 near the end :)

(Also, to be pedantic, line 10 :lol: )

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Aug 25, 2018 10:05 am

Well spotted! Much better now.
Screen Shot 2018-08-25 at 11.04.52.png

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Sat Aug 25, 2018 10:39 am

BigEd wrote:
Sat Aug 25, 2018 10:05 am
Well spotted! Much better now.
Inevitable sped-up URLification:
:idea:
Last edited by lurkio on Sat Aug 25, 2018 10:46 am, edited 1 time in total.

User avatar
davidb
Posts: 2231
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by davidb » Sat Aug 25, 2018 1:54 pm

Something for later in the year, perhaps:

Code: Select all

10VDU23,1,0;0;0;0;
20PRINTSPCRND(20);"*";SPCRND(10);CHR$11;
30GOTO20

User avatar
ctr
Posts: 182
Joined: Wed Jul 16, 2014 2:53 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by ctr » Sat Aug 25, 2018 3:55 pm

I made the wrong trade off with the dragon. Having the NEXT before the PLOT avoids pointlessly redrawing loads of points, but also throws away a lot of new points that were expensive to calculate. Just moving the NEXT from before the PLOT to after the PLOT speeds things up greatly.

Also:
  • Different scaling on line 130 so it fills the screen.
  • Extended the loop on line 100 so it explores more points.

Code: Select all

   10REM ctr - dragon curve ifs
   20MODE0
   30VDU23,1,0;0;0;0;
   40S=1/SQR(2) 
   50A=S*COS(PI/4):B=S*SIN(PI/4)
   60C=S*COS(3*PI/4):D=S*SIN(3*PI/4)  
   70REPEAT
   80X=0:Y=0
   90IFRND(2)=1THENX=1
  100FORC%=1TO30
  110IFRND(2)=1THENZ=A*X-B*Y:Y=B*X+A*Y ELSEZ=C*X-D*Y+1:Y=D*X+C*Y
  120X=Z
  130PLOT69,992-840*X,640-840*Y
  140NEXT
  150UNTIL 0
Attachments
dragon.png

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Aug 25, 2018 4:00 pm

A big improvement, thanks!

Andrew_Waite
Posts: 61
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sat Oct 06, 2018 4:36 pm

I am pleased with this one, it draws a starfield then planets in the foreground.

Code: Select all


   10 MODE1:PRINT"CALCULATING!":VDU19,1,6;0;19,2,5;0;19,3,3;0;
   20 DIM C(360),S(360)
   30 :
   40 FOR N%=0 TO 360
   50 C(N%)=COS(PI*(N%/180)):S(N%)=SIN(PI*(N%/180))
   60 NEXT
   70 :
   80 REPEAT
   90 :
  100 CLS
  110 FOR N%=1 TO 1023
  120 GCOL0,(N%MOD3)+1
  130 PLOT 69,RND(1279),RND(1024)
  140 NEXT
  150 :
  160 FOR P%=0 TO 10
  170 :
  180 GCOL0,0
  190 A%=RND(1279):B%=RND(1023):R%=RND(100)+100
  200 :
  210 FOR N%=0 TO 345 STEP 15
  220 MOVE A%,B%:MOVE A%+(R%*C(N%)),B%+(R%*S(N%)):PLOT 85,A%+(R%*C(N%+15)),B%+(R%*S(N%+15))
  230 NEXT
  240 :
  250 REM MOVE A%,B%:PLOT 153,R%,0 :REM BBC MASTER Option to replace lines 220,230,240
  260 :
  270 FOR M%=0 TO 90 STEP 3
  280 GCOL0,(((M%)DIV3)MOD3)+1
  290 FOR N%=M% TO 180-M%
  300 X%=R%*S(N%):Y%=R%*C(N%)*RND(1):PLOT 69,X%+A%,Y%+B%
  310 NEXT
  320 NEXT
  330 NEXT
  340 :
  350 UNTIL FALSE

Last edited by Andrew_Waite on Sat Oct 13, 2018 1:25 am, edited 2 times in total.

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

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Sat Oct 06, 2018 6:42 pm

Andrew_Waite wrote:
Sat Oct 06, 2018 4:36 pm
I am pleased with this one, draws a starfield then planets in the foreground.
I like! That's actually *very* good. =D> =D>

I first had a DIM Space error on a 'B then realised I had both ADFS and NFS alive and kicking so a quick change around to remove them and all was well! :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!

Andrew_Waite
Posts: 61
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sat Oct 06, 2018 7:58 pm

Here is a '10 Liner' program published in Electron User in 1988, putting my then A-Level trigonometry to good use.

It draws a helicopter in MODE2 with ellipses with multicolour sectors for rotors, then uses palette switching to make the blades rotate.

There is a copy of the original EU article here : http://www.acornelectron.co.uk/mags/eu/ ... /s-p54.jpg

Code: Select all

   
 
   10 REM Helicopter
   20 REM By A M Waite
   30 REM (c) Electron User
   35 ON ERROR MODE3:REPORT:PRINT" at line ";ERL:END
   40 MODE 2:VDU 23,1,0;0;0;0;19,15,1;0;:A%=0:PROCprint(440,512,400,0.1):PROCprint(1040,412,100,1):GCOL 0,15:PROCheli:PROCvdu:END
   50 DEF PROCprint(X%,Y%,R%,C):VDU29,X%;Y%;:MOVE 0,R%*C:FOR N=0 TO 2*PI STEP PI/24:A%=A%+1:IF A%=13 A%=1
   60 GCOL 0,A%:MOVE 0,0:PLOT 85,R%*SIN(N),R%*COS(N)*C:NEXT:VDU 29,0;0;:ENDPROC
   70 DEF PROCvdu:FOR N%=1TO12:VDU 19,N%,0;0;:NEXT:REPEAT:FOR N%=1 TO 12:IF N%=1 VDU 19,12,0;0;
   80 VDU 19,N%,1;0;:VDU 19,N%-1,0;0;:FOR DELAY=0TO100:NEXT:NEXT:UNTIL FALSE:ENDPROC
   90 DEFPROCheli:MOVE 440,512:MOVE 420,412:PLOT 85,460,412:MOVE 1040,412:MOVE 340,312:PLOT 85,340,412:MOVE 800,412:MOVE 600,312:PLOT 85,340,312:MOVE 700,412:MOVE 440,462:PLOT 85,340,412:MOVE 340,412:DRAW 290,400:DRAW 240,370
  100 MOVE 150,312:PLOT 85,240,312:MOVE 150,312:MOVE 160,300:PLOT 85,600,312:PLOT 85,600,300:MOVE 100,270:DRAW 120,260:DRAW 650,260:MOVE 250,300:DRAW 250,260:MOVE 550,260:DRAW 550,300:ENDPROC

Last edited by Andrew_Waite on Sat Oct 13, 2018 1:28 am, edited 7 times in total.

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Sat Oct 06, 2018 8:54 pm

Andrew_Waite wrote:
Sat Oct 06, 2018 4:36 pm
I am pleased with this one, draws a starfield then planets in the foreground [...]
Very nice!:

=D> =D> =D>

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

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sun Oct 07, 2018 7:41 am

Oh, yes, very nice! (Thanks for the URLification lurkio)

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

Re: Any short type-ins for unattended Beebs?

Post by lurkio » Mon Oct 08, 2018 8:45 pm

BigEd wrote:
Sun Oct 07, 2018 7:41 am
Oh, yes, very nice! (Thanks for the URLification lurkio)
No worries. I just want these type-ins to be as easily accessible as possible because they're brief, clever and very impressive!

:idea:

Andrew_Waite
Posts: 61
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Tue Oct 09, 2018 3:42 am

This program sets loose lots of Jet Set Willys to march across the screen of the BBC Micro.

Code: Select all


   10 MODE 1:VDU 23,1,0;0;0;0;
   20 VDU 23,224,60,60,126,52,62,60,24,60,23,225,0,0,0,0,0,0,0,0,23,226,126,126,247,251,60,118,110,119,23,227,0,0,0,0,0,0,0,0
   30 VDU 23,228,15,15,31,13,15,15,6,15,23,229,0,0,128,0,128,0,0,0,23,230,27,27,27,29,15,6,6,7,23,231,128,128,128,128,0,0,0,0
   40 VDU 23,232,3,3,7,3,3,3,1,3,23,233,192,192,224,64,224,192,128,192,23,234,7,7,15,15,3,7,6,7,23,235,224,224,112,176,192,96,224,112
   50 VDU 23,236,0,0,1,0,0,0,0,0,23,237,240,240,248,208,248,240,96,240,23,238,1,3,7,6,0,1,3,3,23,239,248,252,254,246,248,218,14,140
   60 PRINT TAB(0,1);STRING$(20,CHR$(224)+CHR$(225));TAB(0,2);STRING$(20,CHR$(226)+CHR$(227));TAB(0,5);STRING$(20,CHR$(228)+CHR$(229));TAB(0,6);STRING$(20,CHR$(230)+CHR$(231));
   70 PRINT TAB(0,9);STRING$(20,CHR$(232)+CHR$(233));TAB(0,10);STRING$(20,CHR$(234)+CHR$(235));TAB(0,13);STRING$(20,CHR$(236)+CHR$(237));TAB(0,14);STRING$(20,CHR$(238)+CHR$(239));
   80 PRINT TAB(0,17);CHR$(225)+STRING$(19,CHR$(224)+CHR$(225))+CHR$(224);TAB(0,18);CHR$(227)+STRING$(19,CHR$(226)+CHR$(227))+CHR$(226);
   90 PRINT TAB(0,21);CHR$(229)+STRING$(19,CHR$(228)+CHR$(229))+CHR$(228);TAB(0,22);CHR$(231)+STRING$(19,CHR$(230)+CHR$(231))+CHR$(230);
  100 PRINT TAB(0,25);CHR$(233)+STRING$(19,CHR$(232)+CHR$(233))+CHR$(232);TAB(0,26);CHR$(235)+STRING$(19,CHR$(234)+CHR$(235))+CHR$(234);
  110 PRINT TAB(0,29);CHR$(237)+STRING$(19,CHR$(236)+CHR$(237))+CHR$(236);TAB(0,30);CHR$(239)+STRING$(19,CHR$(238)+CHR$(239))+CHR$(238);
  120 REPEAT:FOR S%=&3000 TO &7600 STEP &A00:OSCLI("FX19"):VDU23;12,S%DIV2048;0;0;0:VDU23;13,S%MOD2048DIV8;0;0;0:FOR DELAY=0TO200:NEXT:NEXT:UNTIL FALSE
 
Last edited by Andrew_Waite on Sat Oct 13, 2018 1:23 am, edited 2 times in total.

User avatar
marcusjambler
Posts: 447
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: Any short type-ins for unattended Beebs?

Post by marcusjambler » Tue Oct 09, 2018 7:26 am

lots of Jet Set Willys to march across the screen of the BBC Micro.
:lol: =D>

Post Reply