scene.org File Archive

File download

<root>­/­parties­/­2022­/­vccc22­/­christmas_star_challenge/oddline_openfirmware_forth_vc3-2022.zip

File size:
337 847 bytes (329.93K)
File date:
2022-12-30 11:32:13
Download count:
all-time: 5

Preview

  • decompiled.jpeg 182.04K
  • file_id.diz 1.35K
  • oneliner.fth 196B
  • result.jpeg 140.77K
  • source.fth 301B
  • source.png 6.02K
  • source_std.fth 360B
  • star.fc 108B

file_id.diz

Vintage Computing Christmas Challenge 2022 - Star Power(PC)

Author: oddline
Category: Christmas Challenge
System: PowerBook G4 (PowerBook6,8) BootROM
Language: Open Firmware Forth / FCode, 4.9.0f0 BootROM
Len source code: 196 bytes
Len exe file: 108 bytes
Instructions:

Sorry, I'm not aware of any readily available Open Firmware or FCode emulator!

If you have any new world Power Mac, you can run this on hardware.
I wouldn't bother trying to load the FCode, it's quite a hassle; just boot to
Open Firmware (boot holding down Cmd+Option+O+F), then at the prompt, type out
the contents of oneliner.fth.

If you just want to run the Forth source, though, I've included a version
adapted for gforth and other standards-compliant Forths in source_std.fth.
(Open Firmware Forth expects different syntax for string and integer literals.)
Just run e.g. `gforth source_std.fth`.

Description:

The star is run-length encoded as a series of bytes.

As the symmetry makes this encoding a palindrome, only half of it is typed out;
it's looped through twice, first forwards and then backwards, to make the star.

This version is optimised for FCode bytecode size; I have a different version
with a shorter one-liner (168 bytes) but much larger bytecode (162 bytes).
(Many integer literals are very short to type, but make large bytecode.)

Comments:

Thanks for a fun little challenge :)