agarbiak / tuRingMachine

Turing machine examples in R

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add user input validation

agarbiak opened this issue · comments

Ensure that user input is valid for the binary_add_one() function before executing the Turing machine.
Suggest that a lookup is performed against the instruction_set object for the tape alphabet symbols as a standard feature.
Additional validation will be required for specific tuRingMachine functions.

input <- c(
blank_symbol, # Pre-tape input
strsplit(as.character(input), split="")[[1]],
blank_symbol # End of tape input
)

binary_add_one has been removed from the defined Turing machine functions.