Added JumpTo
This commit is contained in:
10
machine.hpp
10
machine.hpp
@@ -35,6 +35,7 @@ enum : int {
|
||||
DivideBy,
|
||||
ModulusBy,
|
||||
SetTo,
|
||||
JumpTo,
|
||||
Print,
|
||||
|
||||
// Type
|
||||
@@ -63,7 +64,7 @@ private:
|
||||
processCommand(command);
|
||||
return;
|
||||
|
||||
// Arithmatic
|
||||
// Arithmetic
|
||||
case SetTo:
|
||||
memory[currentPosition] = command;
|
||||
break;
|
||||
@@ -83,10 +84,12 @@ private:
|
||||
memory[currentPosition] %= command;
|
||||
break;
|
||||
|
||||
case JumpTo:
|
||||
currentPosition = command;
|
||||
break;
|
||||
case Print:
|
||||
handlePrint(command);
|
||||
State = NoCommand;
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
std::terminate();
|
||||
@@ -124,6 +127,7 @@ private:
|
||||
|
||||
// Double Argument Commands
|
||||
case Print:
|
||||
case JumpTo:
|
||||
case SetTo:
|
||||
case IncrementBy:
|
||||
case DecrementBy:
|
||||
|
||||
Reference in New Issue
Block a user