News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

The Vintage Computing Christmas Challenge 2023

Started by Typhon, 23:54, 12 December 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Typhon

Anyone else taking part in this?






The info from the webpage:

  • Software:

    • Create a program that creates the object as seen within the images above, 1:1 
    • Exactly the same shape

      • The final screen may not include any additional characters(, which are not from the operating system itself).
        Your program must not draw anything else on screen than the object itself.
      • Prompt like READY may appear.
    • No need to clear the screen.  But you can. And you may write spaces.
    • The object can be anywhere on the screen. e.g. left top, centred, a.s.o. 
    • Any colour is allowed (but please not the same as background one)
    • Program termination:

      • The program can finish normally afterwards (return to prompt)
      • The program may loop
      • It may wait for key
      • It may not crash
  • Hardware:

    • Use any machine you like, preferable vintage computers ;-)
    • Make the size of the program file (e.g. PRG on C64) as small as possible
    • Don't manipulate the file (e.g. truncating the last bytes, changing the start address, etc. Mainly valid for "standard files" in BASIC and other languages.)
  • About languages:

    • Use any language you like, preferable on vintage computers ;-)
    • If you use BASIC:

      • Do not include own assembler code

        • PEEK and POKE are allowed
        • Even SYS is allowed (though not preferred)
      • If possible, provide the basic code as text format
    • If you use assembler:

      • Measure the size of the executable (including BASIC starter stub)
      • If possible, measure the size of the code only
      • Please provide the source code and tell us which assembler was used
  • Release

    • You should not publish the code, or it's exact size, before the deadline. Please respect the personal challenge of others.
    • Your submitted code will be released to the public (for example on sites like scene.org or demozoo.org)
  • Target:

    • Use your old computer / programming language (or new one, if you want)
    • Try to optimize the program (for minimum size or maximum beauty ;-)
    • Have fun!


I'm trying an entry in ASM.

Prodatron

#1
I made a quick try and reached 81 bytes in assembler on a CPC, without CLS, wait for key etc, just printing the characters, using the firmware (#BB5A).
Maybe there is some cool math behind it and you can do it with much smaller code, no idea.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

ervin

This sounds like fun. I will throw something together just for the hell of it.  :)

lmimmfn

I won't have time, but the math part seems simple, just from the initial point of horizontal position 4(repeated 3 times) next line is +1/-1 from char 4(repeated 3 times) until horizontal char is at position 1 then invert so -1/+1 repeating 3 times.
Repeat the loop 3 times for vertical.
81 bytes is impressive, surely can be done in ~45 bytes though?
It's a really nice problem(and challenge) to optimize.
6128 for the win!!!

Prodatron

Oh, indeed, you are right!
My first approach was using some kind of compressed text data.
Now with using a math based approach I reached 50 bytes (including a CLS).

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Prodatron


GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Typhon

I thought I was doing well to get under 100 bytes!
:D

Seriously, it's a fascinating challenge.

ervin

74 bytes.
How on earth are you getting 49 bytes @Prodatron?

I know my algorithm skills are nowhere near as good as yours, but 49 bytes is incredible!

Prodatron

As CLS doesn't seem to be required, and it doesn't need to return to the prompt, I am now at 43 bytes.
But I am sure someone like MadRam can do it with half of the bytes :D

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

GUNHED

#9
To optimise for short code: understood!  8)

Optimize for maximum beauty?
Beauty of the code or the picture?
Picture shall have 'Exactly the same shape'
Please explain.  :)

For a 'short code' I can go down to two bytes. By unfair means or course.

On CPC: Do we need to count the file-header?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Prodatron


Quote from: GUNHED on 15:13, 13 December 23For a 'short code' I can go down to two bytes. By unfair means or course.
You won't be able to produce this shape with a 2 byte code.


Quote from: GUNHED on 15:13, 13 December 23On CPC: Do we need to count the file-header?
No, at the end only the pure Z80 code will be counted (see last year).


Btw, I reached 38 bytes now :D

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

GUNHED

38 bytes without cheating is great!  :) :) :)

However if the header doesn't count: Even zero bytes can be reached - with cheating of course.  ;)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Prodatron

#12
Shiiiit, I made a mistake and now I am back at 49 bytes  >:( I wonder if there is still another better approach...

@GUNHED, maybe you can share your thoughts about how to cheat and need 0 bytes. No idea, what you are talking about.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

GUNHED

If you don't beat me up for this...  :laugh:

Cheating means to start a 0-bytes program. And the 'start address' of the program points just at an address of the OS itself. And right there at his address the OS has a small routine just painting the stars.  :-X :-\ :picard:
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

ervin

#14
53 bytes (without CLS).
I have no idea how this is possible in 38 bytes!

ervin

Quote from: ervin on 05:40, 15 December 2353 bytes (without CLS).
I have no idea how this is possible in 38 bytes!
Oops, I noticed that the latest attempt was 49 bytes.
I still don't know how that's possible!

Prodatron

53 bytes is good already!
I am now at 43 bytes again.
But an MSX friend now did it with 32 bytes, phew!!

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

ervin

I can't wait to see the code!
32 bytes... wow.

SpDizzy

Wow! This is damn good! My first approach reached 46 bytes (with no CLS). Need to rethink about it

Prodatron


GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

lightforce6128

37 bytes? Unbelievable. :o

This is a really nice challenge. The pattern to reproduce has much of symmetries and structures. And it clearly fits to this time in the year - a few days ago I helped my brother to place something similar at his hedge.

I started with a simple BASIC program. Then I found another approach, and another. Finally I had five BASIC programs. I picked the one that seems to be the simplest and shortest one and transferred it to assembler. Here I reached 55 bytes. Maybe I can press out 7 more bytes. But then even 11 more, this is something I cannot imagine. Maybe I should have a look at one of the other approaches ...

lightforce6128

The 7 bytes are gone. And then, with some scary tricks, I could also remove 11 more bytes. So I reached 37 bytes, too. But now I'm quite sure that this approach cannot be compressed further.

I do not have much experience with size coding. If two people come up with a program with the same size and the optimization steps looks similar, does this mean it is the same approach, or can it still be something completely different?

lmimmfn

I spent some time analysing this in Java today just to get a quick analysis of the problem in a few mins.

It's fascinating and a brilliant problem at the same time.

After analysing the problem I just let my subconscious do its thing(sounds a bit mad but that's how I do most programming, let my subconscious do the heavy lifting and let my conscious know when there's a result, which in this case was Christmas shopping today lol).

Anyways for sure I have the concepts required to have the most effecent code to generate this, the intriguing thing is code wise it has huge optimization possibilities.

Sub 30 byte code is easily possible with potential to hit 20 bytes, that MSX guys 22 bytes should be achievable.

I'll give it a try tomorrow if I have time, otherwise after tomorrow the first person to PM me I will send the solution concept.
6128 for the win!!!

ervin

#23
Quote from: lmimmfn on 21:09, 16 December 23I spent some time analysing this in Java today just to get a quick analysis of the problem in a few mins.

It's fascinating and a brilliant problem at the same time.

After analysing the problem I just let my subconscious do its thing(sounds a bit mad but that's how I do most programming, let my subconscious do the heavy lifting and let my conscious know when there's a result, which in this case was Christmas shopping today lol).

Anyways for sure I have the concepts required to have the most effecent code to generate this, the intriguing thing is code wise it has huge optimization possibilities.

Sub 30 byte code is easily possible with potential to hit 20 bytes, that MSX guys 22 bytes should be achievable.

I'll give it a try tomorrow if I have time, otherwise after tomorrow the first person to PM me I will send the solution concept.

I can't imagine doing this in 30 bytes (or even 40), and certainly not 20!!!
And I've been staring at this pattern for days!
I'm not very good at obscure z80 tricks though, so that's a problem.  :laugh:

arnolde

I was about to start thinking about it today, but 32 bytes! Chapeau!
I participated in the last 2 years but this pattern is for sure the most interesting and hard one to tackle...

Powered by SMFPacks Menu Editor Mod