@Override
    public void run(Renderer renderer, Solver[] solvers) {
        while(true){
            
            int action = askForNumber("  1 map  |  2 maze  |  3 exit", 1, 3);
            if (action==3) break;
            int size = askForNumber("Please enter the desired width (4-100)", 4, 100);
            
            char[][] map = null;
            
            if (action==1){
                //generate a map
                map = MapGenerator.generate(size);
            } else if (action==2){
                //generate a maze
                map = MazeGenerator.generate(size);
            }

            //go through all the solvers
            for (Solver s:solvers){
                if (s == null) continue;

                //print the solvers name
                System.out.println("--------------------");
                System.out.println(s.getName());
                System.out.println("--------------------");
                //calculate the solution
                char[][] solved = s.solve(map);
                //render the solution or the map with no route
                if (s.isSolved()){
                    renderer.render(solved);
                    //print the path length
                    System.out.println("Path length: "+s.getSolutionLength());
                }else{
                    renderer.render(map);
                    System.out.println("No solution found :(");
                }
                //print the amount of nodes checked
                System.out.println("Nodes checked: "+s.getNodesChecked()+"/"+(map.length*map[0].length));
            }
        }
    }