Implementing A* into a JavaFX program