src/main/java/cursor/rybak/game/UserInteraction.java
/**
     * ask about game mode (for maze edition)
     *
     * @return game mode
     */
ask about game mode (for maze edition)
@return game mode
ask about game mode ( for maze edition ) @return game mode
public static String askGameMode() {
        String[] options = {"easy", "medium", "hard"};
        Message.askGameMode(String.join(", ", options));
        while (true) {
            String userInput = in.nextLine().toUpperCase().trim();
            for (Mode mode : Mode.values()) {
                if (userInput.equals(mode.name())) {
                    return userInput;
                }
            }
            ErrorMessage.errorInfo();
        }
    }
public static String askGameMode ( ) { String [ ] options = { "easy" , "medium" , "hard" } ; Message . askGameMode ( String . join ( ", " , options ) ) ; while ( true ) { String userInput = in . nextLine ( ) . toUpperCase ( ) . trim ( ) ; for ( Mode mode : Mode . values ( ) ) { if ( userInput . equals ( mode . name ( ) ) ) { return userInput ; } } ErrorMessage . errorInfo ( ) ; } }
ask about game mode (for maze edition)
 @return game mode
ask about game mode ( for maze edition ) @return game mode