PRESENT Author: regregex Category: Christmas Challenge System: BBC Micro A/B/Master, Acorn Electron Language: BBC BASIC Len source code: 110 bytes Len exe file: 87 bytes Len code only: 87 bytes Instructions: Install and open BeebEm ( http://www.mkw.me.uk/beebem/ ). Click File -> Disc Options -> New Disc 0, enter present.ssd Click Edit -> Import Files to Disc -> Disc 0, select present.inf At the BASIC prompt, type CHAIN"PRESENT" and press RETURN. To reproduce the screenshots: Click Hardware -> BBC Model -> BBC Master 128 Enter the following: *INSERT 9 *CONFIGURE FILE 9 *CONFIGURE MODE 4 Press Ctrl+F12 (CTRL+BREAK), releasing Ctrl last. Then follow the instructions above. Description: The program runs under BBC BASIC version 1 and up. First it selects display MODE 4, an ASCII mode with square pixels that has the backslash character; this automatically clears the screen and places the cursor at the top left. It positions the cursor with six newlines and 19 spaces, then prints the bow on the centreline and leaves the cursor to its right. For each of the nineteen rows of the box, the program prints a newline followed by eleven spaces to move the cursor towards the centre. Then the nineteen characters of each row are printed, each selected from a four-character string according to whether the X and/or Y co-ordinates are non-zero, modulo 9. (SGN is the most efficient way to decide as the inequality operators are non-associative and return a negative integer when true.) 256 spaces are printed inside the box to align the ribbon and right edge vertically. Finally it waits for a keypress, then exits. Comments: Suitable for an SBC running BASIC if the MODE 4 statement is removed. GET returns a number (the ASCII code of the key pressed) which IF, having no THEN or ELSE clause, discards.