Comet64 - My Solutions


Table of Contents

Game info

Comet 64 is a programming puzzle game. The year is 1984. All you got is a Comet 64 home computer and the operator's manual it came with.

Disk1

Launch Discount (2/30)

reg = input * 0.8;
output = reg;

Why so Negative (2/30)

int = input * -1;
output = int;

BMI Guest (5/50)

int = input;
reg = input;
reg = reg * reg;
reg = int / reg;
output = reg;

What Goes Up (2/200)

int = int + 1;
output = int;

Must Come Down (3/302)

int = 100 - reg;
output = int;
reg = reg + 1;

Compare the Pair (7/64)

reg = input;
int = input;
check reg > int;
jump if false: emit;
int = reg;
emit:
output = int;

The Doppelgänger (6/91)

loop:
int = input;
check int = reg;
reg = int;
jump if false: loop;
output = int;

Sum'bitch (7/110)

loop:
reg = input;
int = int + reg;
check reg > 0;
jump if true: loop;
output = int;
int = 0;

Round About (2/30)

int = input + 0.5;
output = int;

Just Around (4/60)

reg = input / 10;
int = reg + 0.5;
int = int * 10;
output = int;

Disk2

Any Leftovers? (5/75)

reg = input;
int = reg / 4;
int = int * 4;
reg = reg - int;
output = reg;

Some Leftovers (9/89)

TODO Optimize

loop:
reg = input;
int = reg / 4;
int = int * 4;
reg = reg - int;
check reg = 3;
jump if false: loop;
int = int + 3;
output = int;

Differentiator (4/40)

int = input - input;
int = int * int;
check int > 31.1337;
output = bool;

Reverse Integeering (6/90)

reg = input / 10;
int = reg;
reg = reg - int;
reg = reg * 100;
reg = reg + int;
output = reg;

Doppelganger 2 (2/20)

check input = input;
output = bool;

Heads & Tails (16/657)

top:
check input = heads;
jump if false: nxt;
int++;
nxt:
check input = null;
jump if false: top;
str = draw;
check int = 50;
jump if true: emit;
str = tails;
check int < 50;
jump if true: emit;
str = heads;
emit:
output = str;

Big Brother (12/108)

int = input;
reg = input;
check int < reg;
jump if false: next;
int = reg;
next:
reg = input;
check int < reg;
jump if false: emit;
int = reg;
emit:
output = int;

Middle Brother (21/182)

TODO Optimize

reg = input;
int = input;
check reg < int;
jump if true: maxint;
switch int;
int = reg;
switch reg;
maxint:
switch int;
int = reg;
reg = input;
check reg < int;
jump if false: candreg;
reg = int;
candreg:
switch int;
check reg < int;
jump if true: emit;
reg  = int;
emit:
output = reg;

Greatest of Brothers (10/207)

int = input;

loop:
reg = input;
check reg > int;
jump if false: nxt;
int = reg;
nxt:
check input = null;
jump if false: loop;

output = int;

Golden Spiral (13/614)

int = input + 1;
switch int;
int = 0;
reg = 1;
output = reg;
loop:
output = reg;
int = reg - int;
reg = int + reg;
switch int;
check reg < int;
switch int;
jump if true: loop;

Disk3

Easier Than It Looks (4/80)

int = input;
reg = int - 1;
int = int * reg;
output = int;

Harder Than It Looks (5/100)

int = input * 10;
reg = int - 10;
reg = int * reg;
reg = reg / 100;
output = reg;

Give me a Ballpark (7/52)

TODO Optimize

loop:
reg = reg + input;
int++;
check input = null;
jump if false: loop;
reg = reg / int;
output = reg;

Black Jack (11/255)

TODO Optimize

loop:
check input = null;
jump if true: emit;
int = input;
reg = reg + int;
check reg < 22;
jump if true: loop;
reg = reg - int;
emit:
output = reg;
reg = int;

Initial Impression (3/60)

str = input;
char = str[0];
output = char;

Lasting Impression (4/80)

str = input;
int = str.length - 1;
char = str[int];
output = char;

thelongeststring (13/155)

TODO Optimize

loop:
check input = null;
jump if true:emit;
str = input;
int = str.length;
check int > reg;
jump if false: loop;
reg = int;
switch str;
jump to: loop;
emit:
switch str;
output = str;

46temoc (15/553)

str = input;
int = str.length - 1;
reg = 0;
cont:
char = str[reg];
switch char;
char = str[int];
str[reg] = char;
switch char;
str[int] = char;
reg++;
int--;
check reg > int;
jump if false: cont;
output = str;

46cemot (27/2850)

TODO Optimize

str = input;
int = str.length - 1;

loop:
check int = 0;
jump if true: emit;
char = str[int];
reg = char;
int--;
char = str[int];
switch int;
int = char;
check int > reg;
jump if true: swap;
switch int;
jump to: loop;
swap:
switch int;
char = reg;
str[int] = char;
int++;
switch reg;
char = reg;
str[int] = char;
int = str.length - 1;
jump to: loop;

emit:
output = str;

TODO Comet LXVI (/)


Disk4

Coordinate Pairs (3/30)

reg = input;
int = input;
output = reg, int;

Secret Message (13/796)

str = input;
int = str.length;
loop:
int--;
char = str[int];
check char = g;
jump if false: nxt;
char = e;
str[int] = char;
nxt:
check int > 0;
jump if true: loop;
output = str;

Root Input (14/1010)

reg = input;
nxt:
int = char;
int = int * int;
check reg = int;
jump if true: emit;
int = char;
int++;
char = int;
jump to: nxt;
emit:
int = char;
output = int;
char = a;

Negative Initiative (10/167)

TODO Optimize

loop:
int = input;
check int < 1;
jump if false: loop;
output = int;
check int = 0;
jump if true: loop;
cleanup:
check input = 0;
jump if false: cleanup;

As Easy as 01 10 11 (17/880)

TODO Optimize

reg = input + 1;
int = 16;
loop:
check int < 2;
jump if true: emit;
int = int / 2;
check int < reg;
jump if true: one;
str = str + 0;
jump to: loop;
one:
reg = reg - int;
str = str + 1;
jump to: loop;
emit:
output = str;
str = ;

TODO Binary Transition (/)


No Duplicates! (6/46)

loop:
int = int + input;
check input = null;
jump if false: loop;
int = int - 45;
output = int;

No Duplicates (52/55)

TODO Optimize

loop:
int = input;
char = int;
str = str + char;
check input = null;
jump if false: loop;
char = str[0];
int = char;
char = str[1];
reg = char;
check reg = int;
jump if true: emit;
char = str[2];
reg = char;
check reg = int;
jump if true: emit;
char = str[3];
reg = char;
check reg = int;
jump if true: emit;
char = str[4];
reg = char;
check reg = int;
jump if true: emit;
char = str[1];
int = char;
char = str[2];
reg = char;
check reg = int;
jump if true: emit;
char = str[3];
reg = char;
check reg = int;
jump if true: emit;
char = str[4];
reg = char;
check reg = int;
jump if true: emit;
char = str[2];
int = char;
char = str[3];
reg = char;
check reg = int;
jump if true: emit;
char = str[4];
reg = char;
check reg = int;
jump if true: emit;
char = str[3];
int = char;
emit:
output = int;

Let's Settle This (14/112)

// paper + rock = paper (len:9)
// rock + scissors = rock (len:12)
// paper + scissors = scissors (len:13)
str = input + input;
int = str.length;

str = paper;
check int = 9;
jump if true: emit;

str = rock;
check int = 12;
jump if true: emit;

str = scissors;
check int = 13;
jump if true: emit;

str = draw;
emit:
output = str;

[A]

full_on (1/32)

output = true;

one_on (3/95)

check int = 0;
output = bool;
int++;

one_off (3/95)

check int < 31;
output = bool;
int++;

striped_vertical (2/32)

output = true;
output = false;

striped_horizontal (5/160)

str = ttttffffttttffffttttffffttttffff;
char = str[int];
int++;
check char = t;
output = bool;

outer_circle (5/160)

str = tttttffttffttffttffttffttffttttt;
char = str[int];
int++;
check char = t;
output = bool;

inner_circle (5/160)

str = fffffffffttffttffttffttfffffffff;
char = str[int];
int++;
check char = t;
output = bool;

forward_slash (5/160)

str = ffftfftfftfftfffffftfftfftfftfff;
char = str[int];
int++;
check char = t;
output = bool;

back_slash (5/160)

str = tfffftfffftffffttfffftfffftfffft;
char = str[int];
int++;
check char = t;
output = bool;

[B]

output_bool (3/96)

int++;
check int > 13;
output= bool;

checker_board (5/160)

str = tftfftfttftfftfttftfftfttftfftft;
char = str[int];
int++;
check char = t;
output = bool;

ascending_order (5/160)

str = tftfftffftfffftffffftfffffftffff;
char = str[int];
int++;
check char = t;
output = bool;

middle_path (5/160)

str = fttfffffttfffffttfffffttfffffttf;
char = str[int];
int++;
check char = t;
output = bool;

criss_cross (5/160)

str = fftfftfftfffftfffftfffftfftfftff;
char = str[int];
int++;
check char = t;
output = bool;

shooting_stars (3/32)

output = false;
output = false;
output = true;

upper_right (5/160)

str = ttttftttffttffftttttftttffttffft;
char = str[int];
int++;
check char = t;
output = bool;

play_button (5/160)

str = tfffttfftttftttttttttttfttfftfff;
char = str[int];
int++;
check char = t;
output = bool;

hiroshima (5/160)

str = tfttfftttfffttttfffftttttffffftt;
char = str[int];
int++;
check char = t;
output = bool;