This provides a quick rundown of how to perform various commands.
All commands follow the same basic flow:
Command ID -> Command Fields -> Command Value
Every Y2K command should start by referencing a command ID. If you wanted
to print something, your command would start with 9
, if you wanted to
create a new variable, your command would start with 8
, and so on.
Command | Description | ID |
---|---|---|
PRINT |
Print variable or string | 9 |
CREATE |
Create a new variable | 8 |
MODIFY |
Modify an existing variable | 7 |
CONDITION |
Create a condition | 6 |
META |
Modify interpreter state | 5 |
CONTINUE |
Continue (in loop) | 4 |
After the command ID, the next N digits should complete the required fields for the specified command. If a command has 3 fields, then the next 3 digits would be assigned to those fields, for example.
Command ID | Fields |
---|---|
9 (PRINT ) |
|
8 (CREATE ) |
|
7 (MODIFY ) |
|
6 (CONDITION ) |
|
5 (META ) |
|
After the command ID and fields are set, the next step is to read in a value
that matches the "Size" field (if applicable). For example, if you're creating
a new variable, and the variable size is set to 4
, the next 4 digits would
contain the variable's value. If you're modifying an existing variable, and the
argument size is 3
, the next 3 digits would contain the argument value for the
modifier function.
PRINT
statements don't have a size field. Depending on the Type
specified,
a print statement either:
String
: Converts the following digits into characters until a 2-space sequence is reached. See Character Codes for help.Variable
: Use the next digit as a variable ID, and prints that variable
Once the command value is set, the interpreter returns to the start and looks for the next command ID to repeat this process over again.
Number | Character | Number | Character |
---|---|---|---|
0 | (whitespace) |
||
1 | a | 27 | A |
2 | b | 28 | B |
3 | c | 29 | C |
4 | d | 30 | D |
5 | e | 31 | E |
6 | f | 32 | F |
7 | g | 33 | G |
8 | h | 34 | H |
9 | i | 35 | I |
10 | j | 36 | J |
11 | k | 36 | K |
12 | l | 37 | L |
13 | m | 38 | M |
14 | n | 39 | N |
15 | o | 40 | O |
16 | p | 41 | P |
17 | q | 42 | Q |
18 | r | 43 | R |
19 | s | 44 | S |
20 | t | 45 | T |
21 | u | 46 | U |
22 | v | 47 | V |
23 | w | 48 | W |
24 | x | 49 | X |
25 | y | 50 | Y |
26 | z | 51 | Z |
Number | Character |
---|---|
52 | 1 |
53 | 2 |
54 | 3 |
55 | 4 |
56 | 5 |
57 | 6 |
58 | 7 |
59 | 8 |
60 | 9 |
61 | 0 |
!@#$%^&*()+-<>.,
Number | Character |
---|---|
62 | ! |
63 | @ |
64 | # |
65 | $ |
66 | % |
67 | ^ |
68 | & |
69 | * |
70 | ( |
71 | ) |
72 | + |
73 | - |
74 | < |
75 | > |
76 | . |
77 | , |