A small programming contest that run from Friday, 2.12.2022 until Wednesday, 28.12.2022.
If you got motivated to something different as above, this might be for you...
<Name of Release> Author: <Name of Author or Handle / Group> Category: <Christmas Challenge or Wild> System: <Atari, C64, Spectrum ZX80, ...> Language: <BASIC, Assembler, (include the version/variant, ...> Len source code: <# bytes> Len exe file: <# bytes> Len code only: <# bytes> (net code size; subtract the bytes for header/start address; assembler: also subtract the BASIC stub) Instructions: <how to run the code in an emulator> <e.g. which emulator to use and what to do; could be as simple as: Install vice, drag and drop the prg file into it> Description: <how the code works> Comments: <anything left to say>
10 print"{clear}" 20 print"" 30 print"" 40 print"" 50 print" * *" 60 print" ** **" 70 print" *** ***" 80 print" **** ****" 90 print" *****************" 100 print" ***************" 110 print" *************" 120 print" ***********" 130 print" *********" 140 print" ***********" 150 print" *************" 160 print" ***************" 170 print" *****************" 180 print" **** ****" 190 print" *** ***" 200 print" ** **" 210 print" * *" 220 goto 220
This version is not highly optimized.
The shortest size of the following provided sizes is taken for the final "ordering/ranking":
I am aware that you can't compare language A on system B with language X on system Y. That's why the ranking has a rather informative character.
The correctness of your entries lies in your hands.
Of course, I can't check each entry for its correctness as on one hand it would take much time and on the other hand I am not familiar with each machine and language.
Do I need to clear the screen?
No. Usually, you will paint / write on new, empty lines below the cursor. Just don't interfere with the OS messages, which are above the cursor, usually.
Can I write over system messages, or do I have to write starting below the cursor?
Well, you can write everywhere. Also, over the system messages. But your algorithm should not be based on the system message or require it. You could even delete the screen by hand before running your code.
I think comparing different machines and languages is not fair.
True. But it is interesting and as said it is not a competition. At least we can avoid unfair voting on the other hand. Oh, that was not a question. ;-)
Is it necessary, that a C64 BASIC program can also be typed in manually on a real C64? Or in other words, does the 80 characters limit apply for this compo?
No. You can use lines longer than 80 characters. The resulting program must be runnable, of course.
What do you mean by source code?
Source code usually are commands, that a human can read and understand. It will usually be saved as pure text files. The file names may contain some special ending like .bas, .vbs, .js, .py, and so on. The (file) size of this source code is the first kind of measurement. Some source code (e.g. c or assembler) needs to be compiled. Other source code needs to be run using an interpreter.
What do you mean by file size?
This size category is most obvious to compiler languages (assembler, C, Java, ...). There, the source code needs to be compiled to an executable format, which then can be run (mostly) from the command line. But also for some interpreter languages, the size of the saved source code might differ from the source code itself. For example, the C64 will tokenize the commands, it will add some bytes for the line numbers, the start and the end of the file. The Amstrad CPC will add a 128b large header to most files. So the file size might offer advantages or disadvantages, depending on the platform.
What do you mean by executed code?
Again, we have to differentiate between compiled and interpreted code. Most compiled code will have something like a stub to start the main code. Sometimes it's just the start address plus a BASIC stub (C64), sometimes a huge header (Amstrad CPC). Removing this overhead, you get what is meant by "executed code". To make things between interpreters and compilers more fair, you may also subtract the start address or headers from files of system specific file, if they do exist.
Can I use the stub of an assembler program to store data or use side effects of the stub like zero-page or registers variables (e.g. basic line number) set by the stub?
No, you can't. If you do so, you also can't subtract the size of the stub (from the executed code) as a consequence. Exception: start address. Every program needs to start. So, if the starting process sets a register or zero-page address, you can use this side effect.
Can I place my machine code anywhere I want?
Yes. But it would be good, if you provide a working loader.
Can I use language X or system Y?
Well, use whatever you want. Every system will get vintage one day, won't it?
Can I omit the line number from my BASIC program? It's a one-liner.
Most BASIC dialects require the line number so that it becomes a program. Therefore, it can't be removed on such systems.
Thanks for sponsoring of following:
(International postage is not included.)
(I might find some random prize for some random participant. No guarantee though. Remember, it's all for fun!)
But it would still be great, if someone could sponsor (the winner). Just contact me in that case.
Results on YouTube.
Language | Count |
Assembler | 73 |
BASIC | 83 |
Machine | Count | Best Size |
Sinclair | 18 | 27 |
IBM | 8 | 30 |
BK | 8 | 30 |
C64 | 41 | 34 |
C64 (Assembler) | 16 | 34 |
Amstrad | 10 | 37 |
BBC | 25 | 46 |
BBC (BASIC) | 16 | 49 |
Other Commodore | 9 | 57 |
Atari | 17 | 58 |
C64 (BASIC) | 21 | 68 |
Apple | 4 | 108 |
Amiga | 2 | 201 |
C (C64) | 2 | |
BF (C64) | 1 | |
MachineLanguage (C64) | 1 |