added variable pointer start position

This commit is contained in:
2024-03-21 16:38:28 +01:00
parent 8753b6b68d
commit 32c32e4e3a
2 changed files with 9 additions and 0 deletions

View File

@@ -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() {