项目作者: Quentin18

项目描述 :
A* pathfinding visualizer in Ruby
高级语言: Ruby
项目地址: git://github.com/Quentin18/astar-visualizer.git
创建时间: 2020-08-11T14:02:29Z
项目社区:https://github.com/Quentin18/astar-visualizer

开源协议:MIT License

下载


A* Visualizer

A* Visualizer is an interactive application to visualize the
A* pathfinding algorithm
in a grid with obstacles. The heuristic function used is the
Manhattan distance.

It uses the Gosu game development library.

Demo

Install

To install this ruby gem, use the gem command:

  1. gem install astar_visualizer

Usage

To launch the A* Visualizer, use this command:

  1. astar-visualizer

You can also use the irb environment:

  1. require 'astar_visualizer'
  2. AStar.new.show

You can also choose the size of the grid:

  1. astar-visualizer SIZE

SIZE must be a number between 10 and 100 (default: 50).

It will open a window with the grid. Then:

  1. Left click on a node to choose the start node.
  2. Left click on another node to choose the end node.
  3. Left click on nodes to put obstacles. Right click on them if you want to remove them.
  4. Press ENTER to launch the A* algorithm. If a path is found, the path is colored in yellow and the visited nodes in cyan.
  5. Press SUPPR to clear the window.

Author

Quentin Deschamps

License

MIT