Validates all current state with previous state for the rules in the description of the problem .
if ( prev_state === curr_state && curr_state !== 2 ) return false ; if ( prev_state === 2 && curr_state === 0 ) return false ;