Zoadian 10 anni fa
parent
commit
04ec9d440f
1 ha cambiato i file con 37 aggiunte e 39 eliminazioni
  1. 37 39
      README.md

+ 37 - 39
README.md

@@ -2,55 +2,53 @@
 A programming game based on RoboCom.
 
 # Instructions
-| Command            | Cycles              | InstSet | Mobile | Description                                                 | Failures |
-|--------------------|---------------------|---------|--------|-------------------------------------------------------------|----------|
-| CREATE a, b        | 100+50*a+25*b+120*c | 2       | 0      | Create a new pogram with:<br> instSet a; b banks; c mobile  |          |
-| MOVE               | 20                  | 0       | 1      | Move the program one field                                  |          |
-| DIE                | 1                   | 0       | 0      | Destroy the program                                         |          |
-| TRANS a, b         | 14+1*numOfInst      | 1       | 0      | Transfers bank a to bank b in the program in front          |          |
-| RTRANS a, b        | 14+1*numOfInst      | 1       | 0      | Transfers bank afrom program in front to bank b             |          |
-| TURN a             | 8                   | 0       | 0      | Turn by 90°;<br> Turn right if a >= 0 else left             |          |
-| JUMP a             | 1                   | 0       | 0      | Realtive jump for a instructions                            |          |
-| AJUMP a            | 1                   | 0       | 0      | Jump to instruction a in current bank                       |          |
-| BJUMP a, b	     | 2                   | 0       | 0      | Jump to instruction b in bank a                             |          |
+| Command            | Cycles              | InstSet | Mobile | Description                                                                                                  | Failures |
+|--------------------|---------------------|---------|--------|--------------------------------------------------------------------------------------------------------------|----------|
+| CREATE a, b        | 100+50*a+25*b+120*c | 2       | 0      | Create a new pogram with:<br> instSet a; b banks; c mobile                                                   | IS, IP   |
+| MOVE               | 20                  | 0       | 1      | Move the program one field                                                                                   |          |
+| DIE                | 1                   | 0       | 0      | Destroy the program                                                                                          | DI       |
+| TRANS a, b         | 14+1*numOfInst      | 1       | 0      | Transfers bank a to bank b in the program in front                                                           | IS, IB   |
+| RTRANS a, b        | 14+1*numOfInst      | 1       | 0      | Transfers bank afrom program in front to bank b                                                              | IS, IB   |
+| TURN a             | 8                   | 0       | 0      | Turn by 90°;<br> Turn right if a >= 0 else left                                                              |          |
+| JUMP a             | 1                   | 0       | 0      | Realtive jump for a instructions                                                                             |          |
+| AJUMP a            | 1                   | 0       | 0      | Jump to instruction a in current bank                                                                        |          |
+| BJUMP a, b	     | 2                   | 0       | 0      | Jump to instruction b in bank a                                                                              | IB       |
 | SCAN #a            | 8                   | 1       | 0      | Scan 1 field in front.<br> Set a to:<br> 0 if empty;<br> 1 if enemy;<br> 2 if friend                         |          |
-| FARSCAN #a, #b, c  | 10+3*c              | 1       | 0      | Scan n fields in front.<br> Set a to:<br> 0 if empty;<br> 1 if enemy;<br> 2 if friend;<br> Set b to distance |          |
-| SET #a, b          | 2                   | 0       | 0      | #a = b                                                      |          |
-| ADD #a, b          | 2                   | 0       | 0      | #a = #a + b                                                 |          |
-| SUB #a, b          | 2                   | 0       | 0      | #a = #a - b                                                 |          |
-| MUL #a, b          | 2                   | 0       | 0      | #a = #a * b                                                 |          |
-| DIV #a, b          | 2                   | 0       | 0      | #a = #a / b                                                 |          |
-| MOD #a, b          | 2                   | 0       | 0      | #a = #a % b                                                 |          |
-| MIN #a, b          | 2                   | 0       | 0      | #a = min(#a, b)                                             |          |
-| MAX #a, b          | 2                   | 0       | 0      | #a = max(#a, b)                                             |          |
-| RANDOM #a, b, c    | 1                   | 0       | 0      | #a = b + (rand() % (c - b + 1))                             |          |
-| IF a, b            | 2                   | 0       | 0      | Execute next instruction if a == b else skip it             |          |
-| IFN a, b           | 2                   | 0       | 0      | Execute next instruction if a != b else skip it             |          |
-| IFG a, b           | 2                   | 0       | 0      | Execute next instruction if a > b else skip it              |          |
-| IFL a, b           | 2                   | 0       | 0      | Execute next instruction if a < b else skip it              |          |
-| IFGE a, b          | 2                   | 0       | 0      | Execute next instruction if a >= b else skip it             |          |
-| IFLE a, b          | 2                   | 0       | 0      | Execute next instruction if a <= b else skip it             |          |
-| INIT a, b          | 2                   | 0       | 0      | Start a new task at bank a instruction b                    |          |
-| BREAK              | 1                   | 0       | 0      | Stops other tasks, gives current task 100%                  |          |
-| RESUME             | 1                   | 0       | 0      | Resume all other tasks suspended by SEIZE                   |          |
-| SEIZE              | 1                   | 0       | 0      | Stops other tasks, gives current task 100% until RESUME     |          |
-| SLEEP a            | 1                   | 0       | 0      | Suspend current task a cycles                               |          |
-| QUIT               | 1                   | 0       | 0      | Stops current task                                          |          |
+| FARSCAN #a, #b, c  | 10+3*c              | 1       | 0      | Scan n fields in front.<br> Set a to:<br> 0 if empty;<br> 1 if enemy;<br> 2 if friend;<br> Set b to distance | IS, IP   |
+| SET #a, b          | 2                   | 0       | 0      | #a = b                                                                                                       |          |
+| ADD #a, b          | 2                   | 0       | 0      | #a = #a + b                                                                                                  |          |
+| SUB #a, b          | 2                   | 0       | 0      | #a = #a - b                                                                                                  |          |
+| MUL #a, b          | 2                   | 0       | 0      | #a = #a * b                                                                                                  |          |
+| DIV #a, b          | 2                   | 0       | 0      | #a = #a / b                                                                                                  | DZ       |
+| MOD #a, b          | 2                   | 0       | 0      | #a = #a % b                                                                                                  | DZ       |
+| MIN #a, b          | 2                   | 0       | 0      | #a = min(#a, b)                                                                                              |          |
+| MAX #a, b          | 2                   | 0       | 0      | #a = max(#a, b)                                                                                              |          |
+| RANDOM #a, b, c    | 1                   | 0       | 0      | #a = b + (rand() % (c - b + 1))                                                                              | IP       |
+| IF a, b            | 2                   | 0       | 0      | Execute next instruction if a == b else skip it                                                              |          |
+| IFN a, b           | 2                   | 0       | 0      | Execute next instruction if a != b else skip it                                                              |          |
+| IFG a, b           | 2                   | 0       | 0      | Execute next instruction if a > b else skip it                                                               |          |
+| IFL a, b           | 2                   | 0       | 0      | Execute next instruction if a < b else skip it                                                               |          |
+| IFGE a, b          | 2                   | 0       | 0      | Execute next instruction if a >= b else skip it                                                              |          |
+| IFLE a, b          | 2                   | 0       | 0      | Execute next instruction if a <= b else skip it                                                              |          |
+| INIT a, b          | 2                   | 0       | 0      | Start a new task at bank a instruction b                                                                     | IB       |
+| BREAK              | 1                   | 0       | 0      | Stops other tasks, gives current task 100%                                                                   |          |
+| RESUME             | 1                   | 0       | 0      | Resume all other tasks suspended by SEIZE                                                                    |          |
+| SEIZE              | 1                   | 0       | 0      | Stops other tasks, gives current task 100% until RESUME                                                      |          |
+| SLEEP a            | 1                   | 0       | 0      | Suspend current task a cycles                                                                                |          |
+| QUIT               | 1                   | 0       | 0      | Stops current task                                                                                           | UE       |
 
 
 # Failure codes
 | Code | Description                                                                    |
 |------|--------------------------------------------------------------------------------|
-| ET   | Elimination Trigger released                                                   |
-| DH   | Data Hunger (Bank 1 empty and executed)                                        |
+| DH   | Data Hunger: Bank 1 empty and executed                                         |
 | DZ   | Division by zero                                                               |
-| IB   | Invalid bank number (e.g. in TRANS or BJUMP)                                   |
+| IB   | Invalid bank number                                                            |
 | IS   | Higher Instruction Set required                                                |
 | MO   | Mobility required                                                              |
 | DI   | DIE executed                                                                   |
-| IP   | Invalid parameter (e.g. CREATE x, -1, x)                                       |
-| UE   | No more tasks left in a program (Unemployment)                                 |
-| ID   | Instruction duration too high (i.e. > MaxInstrDur)                             |
+| IP   | Invalid parameter                                                              |
+| UE   | Unemployment: No more tasks left in a program                                  |
 
 
 # Variables