src/main/java/cursor/rybak/view/Message.java
/**
     * print neighboring locations
     *
     * @param currentLocation current position in maze
     */
print neighboring locations
@param currentLocation current position in maze
print neighboring locations @param currentLocation current position in maze
public static void printNeighbors(Location currentLocation) {
        System.out.print(CYAN + "\t\tAhh, What we see here..? " + RESET);
        String[] moveOptions = getAndPrintMoveOptions(currentLocation, false).toUpperCase().split("");
        if (moveOptions.length == 1 && BACK_OPTION.equals(moveOptions[0].toLowerCase())) {
            System.out.format(RED + " Its deadlocked, move back..\n" + RESET);
        } else {
            Arrays.stream(moveOptions)
                    .forEach(option -> {
                        String direction = Moves.valueOf(option).getOptionName();
                        if (STRAIGHT_OPTION.equals(option.toLowerCase())) {
                            List<Location> line = currentLocation.getMainLine();
                            Location StraightLocation = line.get(Team.getLocationIndex(line));
                            printNeighborsLabel(StraightLocation, GREEN + direction + RESET);
                        }
                        if (BACK_OPTION.equals(option.toLowerCase())) {
                            List<Location> line = currentLocation.getMainLine();
                            Location BackLocation = line.get(LEFT_OR_BACK);
                            printNeighborsLabel(BackLocation, GREEN + direction + RESET);
                        }
                        if (LEFT_OPTION.equals(option.toLowerCase())) {
                            List<Location> line = currentLocation.getCrossLine();
                            Location LeftLocation = line.get(LEFT_OR_BACK);
                            printNeighborsLabel(LeftLocation, RED + direction + RESET);
                        }
                        if (RIGHT_OPTION.equals(option.toLowerCase())) {
                            List<Location> line = currentLocation.getCrossLine();
                            Location RightLocation = line.get(Team.getLocationIndex(line));
                            printNeighborsLabel(RightLocation, RED + direction + RESET);
                        }
                    });
        }
    }
public static void printNeighbors ( Location currentLocation ) { System . out . print ( CYAN + "\t\tAhh, What we see here..? " + RESET ) ; String [ ] moveOptions = getAndPrintMoveOptions ( currentLocation , false ) . toUpperCase ( ) . split ( "" ) ; if ( moveOptions . length == 1 && BACK_OPTION . equals ( moveOptions [ 0 ] . toLowerCase ( ) ) ) { System . out . format ( RED + " Its deadlocked, move back..\n" + RESET ) ; } else { Arrays . stream ( moveOptions ) . forEach ( option -> { String direction = Moves . valueOf ( option ) . getOptionName ( ) ; if ( STRAIGHT_OPTION . equals ( option . toLowerCase ( ) ) ) { List < Location > line = currentLocation . getMainLine ( ) ; Location StraightLocation = line . get ( Team . getLocationIndex ( line ) ) ; printNeighborsLabel ( StraightLocation , GREEN + direction + RESET ) ; } if ( BACK_OPTION . equals ( option . toLowerCase ( ) ) ) { List < Location > line = currentLocation . getMainLine ( ) ; Location BackLocation = line . get ( LEFT_OR_BACK ) ; printNeighborsLabel ( BackLocation , GREEN + direction + RESET ) ; } if ( LEFT_OPTION . equals ( option . toLowerCase ( ) ) ) { List < Location > line = currentLocation . getCrossLine ( ) ; Location LeftLocation = line . get ( LEFT_OR_BACK ) ; printNeighborsLabel ( LeftLocation , RED + direction + RESET ) ; } if ( RIGHT_OPTION . equals ( option . toLowerCase ( ) ) ) { List < Location > line = currentLocation . getCrossLine ( ) ; Location RightLocation = line . get ( Team . getLocationIndex ( line ) ) ; printNeighborsLabel ( RightLocation , RED + direction + RESET ) ; } } ) ; } }
print neighboring locations
 @param currentLocation current position in maze
print neighboring locations @param currentLocation current position in maze