It will let you write declarative style code instead of imperative. In Battlesnake, A* is a good way to find the way to the closest food, or attack the closest snake. You might be familiar with this if you've ever played a point and click adventure game and seen your character navigate around obstacles to get to where you clicked. Additional Flood Fill Resources Ī* is an algorithm to plot the shortest path between two points on a grid. Often times Battlesnakes will want to consider the available space of each move prior to choosing which move to make. For example, if a Battlesnake were to move into a specific square, flood fill could be used to statically determine how many adjacent squares a Battlesnake could subsequently move into before running out of space. In Battlesnake flood fill is a simple way to detect and avoid enclosed spaces that Battlesnakes may not be able to escape from. A common example is the 'fill' or 'bucket' tool in paint and graphics programs, which finds all pixels within a set boundary. Each algorithm listed should include a widely accessible definition ( think ELI5 style), how it could be applied to Battlesnake, and links to further resources.Ĭontributions and updates are always welcome! Flood Fill įlood fill is an algorithm to determine the boundaries and size of an enclosed space. This page was inspired by BoldBigflank, 101donutman, and Xtagon in the Battlesnake Discord.
0 Comments
Leave a Reply. |