Author: Jonathan Harston Category: Christmas Challenge System: Any system that can run BBC BASIC Language: BBC BASIC Source length: 115 bytes File length: 115 bytes Executable length: 115 bytes Instructions: On any system that can run BBC BASIC, CHAIN "xmas2025c". Description: Plain text output, no centring. Simple enough to be a one-line program. The image demonstrates the program being run with Z80 BBC BASIC on a CP/M system. Uncrunched, the program looks like this: A$=CHR$&49+CHR$&92+CHR$&04+CHR$&09+CHR$&72+CHR$&30+CHR$&51+CHR$&02+CHR$&00 FOR L=-9 TO 9 B=ASCMID$(A$,ABSL,L)AND511 C$="":D$="" FOR D=1 TO 9 C$=CHR$(32+10*(B AND1))+C$ D$=D$+CHR$ASCC$ B=B/2 NEXT PRINT C$;"*";D$ NEXT It encodes the bitmap of a quarter segment of the star as an 8-bit character, noticing that all the lines start with a space other than the centre line. The crunched code takes advantage that characters other than can be stored directly into the string in the program code - though the CHR$&02 means that if the user LISTs the program the printer will spring into life! These codes are extracted from the string by passing though it twice by going from -9 to 9 and indexing with the absolute value. The special case of the centre line gives a full bitmap by taking the ASC value of a zero-length string, masked with 511 to give a 9-bit value. The values are then displayed in binary using '*' and ' ' characters, by building up the strings by rotating the bits out of the value. The string for the right side is built by adding the bits in the opposite order from the left side. They are then printed with an additional '*' for the centre column.