added variable pointer start position
This commit is contained in:
@@ -57,6 +57,11 @@ impl TuringMachine {
|
||||
self.belt[index] = value;
|
||||
}
|
||||
|
||||
pub fn set_pointer(&mut self, index: usize) -> () {
|
||||
// set pointer start position
|
||||
self.pointer = index;
|
||||
}
|
||||
|
||||
pub fn set_transition(&mut self, state: u64, value: Value, next_state: u64) -> () {
|
||||
// If the State is not in the HashMap, add it
|
||||
if self.transitions.get(&state).is_none() {
|
||||
|
||||
Reference in New Issue
Block a user