advent18_tiles.js
/*
Its left and center tiles are traps, but its right tile is not.
Its center and right tiles are traps, but its left tile is not.
Only its left tile is a trap.
Only its right tile is a trap.
*/
Its left and center tiles are traps, but its right tile is not.
Its center and right tiles are traps, but its left tile is not.
Only its left tile is a trap.
Only its right tile is a trap.
Its left and center tiles are traps but its right tile is not . Its center and right tiles are traps but its left tile is not . Only its left tile is a trap . Only its right tile is a trap .
function newTile(left, center, right) {
    if (!isSafe(left) && !isSafe(center) && isSafe(right)) {
        return TRAP;
    }
    if (!isSafe(center) && !isSafe(right) && isSafe(left)) {
        return TRAP;
    }
    if (!isSafe(left) && isSafe(center) && isSafe(right)) {
        return TRAP;
    }
    if (!isSafe(right) && isSafe(center) && isSafe(left)) {
        return TRAP;
    }
    return SAFE;
}
function newTile ( left , center , right ) { if ( ! isSafe ( left ) && ! isSafe ( center ) && isSafe ( right ) ) { return TRAP ; } if ( ! isSafe ( center ) && ! isSafe ( right ) && isSafe ( left ) ) { return TRAP ; } if ( ! isSafe ( left ) && isSafe ( center ) && isSafe ( right ) ) { return TRAP ; } if ( ! isSafe ( right ) && isSafe ( center ) && isSafe ( left ) ) { return TRAP ; } return SAFE ; }
Its left and center tiles are traps, but its right tile is not.
Its left and center tiles are traps but its right tile is not .