use in operator (thanks puw4)

This commit is contained in:
mehbark 2023-04-17 16:49:51 -04:00
parent 855e55bff7
commit 0f348a7e07

View file

@ -261,7 +261,7 @@ const INITIAL_STATE: State = {
};
function steps(state: State, ops: Op[], limit = 300, num_steps = 0): State[] {
if (typeof ops[state.ip] == "undefined" || num_steps > limit) {
if (!(state.ip in ops) || num_steps > limit) {
return [state];
}
return cons(