VCCC2023: Christmas Challenge

bbc micro/electron/atom/risc os coding queries and routines
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: VCCC2023: Christmas Challenge

Post by jgharston »

I only just remembered a couple of hours ago to submit an entry. A few minutes before sending it I realised I'd included a screenshot of an earlier version! Blegh! Had to re-run everything and re-do the screenshots.

I didn't go for a minimalist entry - couldn't seem to get my brain into gear - so went for a wildcard pretty extras version. :)

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: VCCC2023: Christmas Challenge

Post by jgharston »

Ah crap. I've now just thought of an optimisation to remove an IF clause.

Edit: Yep. Saves 12 bytes.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by Diminished »

Well, that's both my entries (sizecoding + wild) sent in, and I'm not happy with either of them.
atsampson
Posts: 67
Joined: Fri Dec 16, 2022 4:54 pm
Location: Dundee, Scotland
Contact:

Re: VCCC2023: Christmas Challenge

Post by atsampson »

I've submitted a couple as well. I don't expect either to be competitive in terms of size, but both are for platforms that nobody submitted last year...

Edit: ... and a third platform just before the deadline, having had an idea over lunch!
Last edited by atsampson on Tue Dec 26, 2023 5:07 pm, edited 1 time in total.
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by Diminished »

Diminished wrote: Mon Dec 25, 2023 12:37 am Well, that's both my entries (sizecoding + wild) sent in, and I'm not happy with either of them.
Logiker graciously gave me an extension to submit my Wild entry, so I'm spending Christmas shouting at Beebasm
julie_m
Posts: 587
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: VCCC2023: Christmas Challenge

Post by julie_m »

Well, now the deadline for entering is past, am I OK to say that if you wrote the size of the lookup table I ended up using as a decimal number and doubled it, then read it as a hex number, that was the size of my first effort that I still managed to round down to end with a 0 in one of those bases?
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by Diminished »

Personally I'd prefer it if people waited for Logiker's video in a few days, but last year people started posting their results as soon as the deadline expired (against my protest). So I think I'm going to check out of this thread now.

See you in January.
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by dp11 »

Would a compromise be the following : Newer people to this games might feel its hard to participate and talk about their entries / ideas because very quickly the code size reduces. So I suggest entries /ideas above 250bytes can can talked about on the 26th, above 200bytes on the 27th and above 150 bytes on the 28th until the results are announced .
fuzzel
Posts: 1191
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: VCCC2023: Christmas Challenge

Post by fuzzel »

Hmm, not many takers so far for the greater than 250 bytes solutions. Maybe everyone's done very well this year. If, like me, you've ran out of steam and would like another programming challenge or two to keep you going for a few days, how about the two competition puzzles below, taken from the December 1983 and January 1984 issues of Acorn User respectively? The first one was relatively straightforward for me but the second one is proving a real headscratcher. Multiple simultaneous equations with an eye-watering number of variables. Ouch! Maybe this is more suited to the maths lovers than the programmers or maybe there's a simpler solution aside from brute force algorithms...
[attachment=1]Acorn User Competition Jan84.png[/attachment]
[attachment=0]Acorn User Competition Dec83.png[/attachment]
Attachments
Acorn User Competition Dec83.png
Acorn User Competition Jan84.png
Acorn User Competition Jan84.png (204.69 KiB) Viewed 7374 times
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: VCCC2023: Christmas Challenge

Post by tnash »

I could do it by hand I think but not without bringing back horrendous memories of 1st year at Uni
elkrepair
Posts: 79
Joined: Tue Nov 13, 2018 1:53 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by elkrepair »

dp11 wrote: Tue Dec 26, 2023 10:19 am Would a compromise be the following : Newer people to this games might feel its hard to participate and talk about their entries / ideas because very quickly the code size reduces. So I suggest entries /ideas above 250bytes can can talked about on the 26th, above 200bytes on the 27th and above 150 bytes on the 28th until the results are announced .
Sounds like a very good idea.
Elk rev 4 & Plus1
BBC B rev 7 & Cumana Disc Drive
BBC micro:bit 1 & 2
RaspberryPi B+ & 3B & Zero
Abit BP6
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: VCCC2023: Christmas Challenge

Post by tnash »

How are we counting size for BASIC? Just TOP–PAGE?
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by dp11 »

tnash wrote: Tue Dec 26, 2023 2:45 pm How are we counting size for BASIC? Just TOP–PAGE?
First post says TOP-PAGE
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: VCCC2023: Christmas Challenge

Post by tnash »

Haha oh dear how did I miss that 😀
User avatar
JohnH
Posts: 85
Joined: Thu Aug 11, 2016 10:59 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by JohnH »

I can't wait to be baffled by how small and cunning and weird some of the entries are, I could barely understand some of last years best entries. Fingers crossed that I'm less than double some of the smallest :lol:
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by dp11 »

Results to be announced Saturday 6pm GMT
Phil_G
Posts: 6
Joined: Mon Jan 16, 2023 10:20 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by Phil_G »

My entry was in assembler on the National SC/MP :)
https://www.mccrash-racing.co.uk/philg/ ... m#xmas2023
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: VCCC2023: Christmas Challenge

Post by jgharston »

I got my pure BBC BASIC, absolutely no bells and whistles vers down to 107 bytes. I'm sure with some extra thought I could have squeezed a bit more, but I've been doing a load of ZX Spectrum coding* over the last week or so.

*Actually, extracting Spectrum Z80 code from lots of projects and tidying them into stand-alone libraries that can be used in other code. I made the mistake of thinking it would be a good idea to optimise the code, and ended up killing some of it. ;) I'd clearly already optimised the code when I originally wrote it.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
elkrepair
Posts: 79
Joined: Tue Nov 13, 2018 1:53 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by elkrepair »

If anyone is interested, the data for the second challenge in fuzzel's post above is:

Code: Select all

  100DATA 10,3,2,3,18,15,13,7,15,11,15,7,9,9,23,4688
  110DATA 14,24,20,25,23,24,7,1,10,15,9,4,11,13,11,4828
  120DATA 9,0,25,3,7,14,5,17,1,13,7,15,4,18,20,4861
  130DATA 22,23,12,3,25,19,13,24,14,10,13,20,24,16,10,7097
  140DATA 24,8,18,17,22,24,18,25,5,11,18,25,22,21,10,7649
  150DATA 15,14,5,20,1,11,7,10,22,24,15,7,8,2,11,4191
  160DATA 25,1,22,17,23,23,18,4,17,21,20,2,6,17,22,5970
  170DATA 20,17,10,22,16,12,4,11,10,6,8,3,17,13,22,5275
  180DATA 4,14,12,23,8,18,20,17,1,15,14,15,2,22,15,5322
  190DATA 14,23,6,6,16,19,8,20,23,20,2,18,12,14,25,6172
  200DATA 24,2,15,1,13,9,10,17,5,0,14,24,16,18,3,5278
  210DATA 25,15,15,15,23,14,18,7,15,13,2,1,0,1,18,3395
  220DATA 7,18,10,24,24,15,11,24,5,19,0,22,18,23,8,6133
  230DATA 18,2,17,0,19,13,13,23,3,16,14,15,21,20,24,7147
  240DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,411
Elk rev 4 & Plus1
BBC B rev 7 & Cumana Disc Drive
BBC micro:bit 1 & 2
RaspberryPi B+ & 3B & Zero
Abit BP6
julie_m
Posts: 587
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: VCCC2023: Christmas Challenge

Post by julie_m »

Is everyone ready to watch the results, then? I haven't felt this excited for about 7 months .....

Here's the annotated version of my entry: https://github.com/JulieMontoya/Random_Beeb_Stuff/tree/main/xmas_comp_2023
fuzzel
Posts: 1191
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: VCCC2023: Christmas Challenge

Post by fuzzel »

Looks like I'm first whilst everyone else is watching the results. This is basically a 3 by 3 grid of diamonds so I set up two For / Next loops to draw 9 diamonds from the centre of each. I noticed that each diamond can be drawn from x coordinates of -3 to +3 from the centre of the diamond and that the two y coordinates for each x coordinate could be calculated as +/- (3 minus the absolute value of the x value).
74 bytes in total.
At a later date I may have a go at an assembly language version although having already thought about it I doubt the code would be smaller.

Code: Select all

5FORA=4TO16STEP6:FORB=4TO16STEP6:FORC=-3TO3:D=3-ABS(C):PRINTTAB(A+C,B+D)"*"TAB(A+C,B-D)"*":NEXT:NEXT:NEXT
Xmas2023 1.jpg
elkrepair
Posts: 79
Joined: Tue Nov 13, 2018 1:53 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by elkrepair »

I did it in two lines of BBC Basic, no DATA, in 75 bytes:

Code: Select all

1D=1:FORT=3TO15STEP6:FORS=1TO2:X=T:FORY=1TO19:PRINTTAB(X,Y)"*":IFX=0ORX=18D=-D
2X=X+D:NEXT,,
Clear the screen then run.

Didn't submit though.
Elk rev 4 & Plus1
BBC B rev 7 & Cumana Disc Drive
BBC micro:bit 1 & 2
RaspberryPi B+ & 3B & Zero
Abit BP6
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: VCCC2023: Christmas Challenge

Post by BigEd »

You can save two bytes, @fuzzel, by using "NEXT,," instead of "NEXT:NEXT:NEXT". Nice approach, though! Simple and direct.
tnash
Posts: 161
Joined: Mon May 02, 2022 9:56 am
Contact:

Re: VCCC2023: Christmas Challenge

Post by tnash »

133 bytes but it is pretty and twinkly particularly if sped up a bit with a copro.

Code: Select all

1MODE2:VDU23;8202;0;0;0;:X=3:U=1:V=1
2X=X+U:Y=Y+V:VDU17,RND(7),31,X,Y,42:IFX MOD3>0GOTO2ELSEIFX MOD18=0U=-U
3IFY MOD18=0V=-V ELSEV=2*RND(2)-3
4GOTO2
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by dp11 »

My 51 byte basic solution with only one variable https://bbcmic.ro/#%7B%22v%22%3A1%2C%22 ... %5Cn%22%7D
User avatar
Rich Talbot-Watkins
Posts: 2054
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: VCCC2023: Christmas Challenge

Post by Rich Talbot-Watkins »

I did it in one line of BASIC:

Owlet link (50 bytes)

and later realised I could save another byte by splitting it over two lines and making it a bit more ugly:

Owlet link (49 bytes)

I could probably explain the incremental process that led to that solution in case anyone were interested!
julie_m
Posts: 587
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: VCCC2023: Christmas Challenge

Post by julie_m »

I'm just amazed by how small the BASIC entries got!
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: VCCC2023: Christmas Challenge

Post by Diminished »

Well, my animated wild entry wasn't even shown moving in the results video, which I thought was miserable.

I won't be participating next year.

https://www.youtube.com/watch?v=komh0jJgaP4
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: VCCC2023: Christmas Challenge

Post by BeebMaster »

No idea if mine was in there. Here it is anyway.

Code: Select all

10FORC=3TO15STEP6:FORA=9TO21STEP6:FORB=-3TO3:PRINTTAB(A+ABSB,C+B)"*"TAB(A+6-ABSB,C-B)"*":NEXT,,
XMas2023-1.png
XMas2023-2.png
Image
User avatar
flaxcottage
Posts: 5718
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: VCCC2023: Christmas Challenge

Post by flaxcottage »

Rich Talbot-Watkins wrote: Sat Dec 30, 2023 6:46 pm I did it in one line of BASIC:

Owlet link (50 bytes)
Respect! :shock:
- John

Check out the Educational Software Archive at www.flaxcottage.com
Post Reply

Return to “programming”