Vintage Computing Christmas Challenge 2022 Author: Peter De Wachter Category: Christmas Challenge System: IBM 5110 Language: APL Len source code: 30 characters Len exe file: N/A Len code only: N/A Instructions: You can find a web-based emulator for the IBM 5110 here: https://norbertkehrer.github.io/ibm_5110/emu5110.html Documentation for this machine is available from bitsavers: http://www.bitsavers.org/pdf/ibm/5110/ The emulator is configured to boot into BASIC by default. Use the switches to the right of the screen to restart in APL mode. When the 5110 is booted in APL, you can just type in the program, just like a BASIC system. Use the shift key to type APL characters. The character ⌽ requires an overstrike: shift-M, cursor left, shift-O. Unfortunately the 5110's screen has only 16 lines, so it's too small to show the entire Christmas star. If you have a real machine, you can send the output to the printer. The program will also work with modern APL implementations. Try running it on tryapl.org. Description: The program is equivalent to this: V ← 4 3 2 1 ¯4 ¯3 ¯2 ¯1 0 ¯1 ¯2 ¯3 ¯4 1 2 3 4 S ← V ∘.≤ -V ' *'[1+S] I found this by trial and error, starting from the standard idiom for creating a triangular matrix. There's probably a mathematical theory that explains why this works, but I don't know it :)