missionaries_game/js/sketch.js
// Function to check whether a state already exists or not in the array
Function to check whether a state already exists or not in the array
Function to check whether a state already exists or not in the array
function repetitionChecker(value) {
  for(let i = 0; i < state.length; i++) {
    if(state[i].value[0] === value[0] && state[i].value[1] === value[1] && state[i].value[2] === value[2]) {
      return true;
    }
  }
  return false;
}
function repetitionChecker ( value ) { for ( let i = 0 ; i < state . length ; i ++ ) { if ( state [ i ] . value [ 0 ] === value [ 0 ] && state [ i ] . value [ 1 ] === value [ 1 ] && state [ i ] . value [ 2 ] === value [ 2 ] ) { return true ; } } return false ; }
Function to check whether a state already exists or not in the array
Function to check whether a state already exists or not in the array