Skip to content
Snippets Groups Projects

Hh6chen dijkstras with reverse

Merged Harrison Chen requested to merge hh6chen-dijkstras-with-reverse into main
6 files
+ 143
37
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 5
0
@@ -11,6 +11,9 @@ struct Command_Token get_next_token(char* command, int* offset) {
} else if (command[(*offset)] == 't' && command[(*offset) + 1] == 'r') {
token.type = COMMAND_TR;
*offset += 2;
} else if (command[(*offset)] == 'r' && command[(*offset) + 1] == 'v' && command[(*offset) + 2] == 'i') {
token.type = COMMAND_RV_I;
*offset += 3;
} else if (command[(*offset)] == 'r' && command[(*offset) + 1] == 'v') {
token.type = COMMAND_RV;
*offset += 2;
@@ -79,6 +82,8 @@ void terminal_admin() {
send_speed_command(tokens[1].value, tokens[2].value);
} else if (tokens[0].type == COMMAND_RV && tokens[1].type == COMMAND_INT && tokens[2].type == COMMAND_EOL) {
send_reverse_command(tokens[1].value);
} else if (tokens[0].type == COMMAND_RV_I && tokens[1].type == COMMAND_INT && tokens[2].type == COMMAND_EOL) {
reverse_instantly(tokens[1].value);
} else if (tokens[0].type == COMMAND_SW && tokens[1].type == COMMAND_INT && tokens[2].type == COMMAND_CHAR
&& tokens[3].type == COMMAND_EOL) {
char switch_num[1] = { tokens[1].value };
Loading