Author Topic: Pipe Game  (Read 251 times)

lelldorin

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • BeSly - Knowledge base
Pipe Game
« on: 07. March 2018, 22:47:29 »
Do you have any idea how to proof if the user have a complete connection from the sztart to the end?



I have no idea how to proof this. The playground is ready. This game is written in yab (yet another basic on Haiku operating system)

ZXDunny

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: Pipe Game
« Reply #1 on: 08. March 2018, 12:16:57 »
There are many ways to do this, check Wiki: https://en.wikipedia.org/wiki/Pathfinding

A* is efficient and will determine if a path between two points on your grid exists. If you're not terribly worried about speed (or memory consumption) then a simple flood fill will be more than equal to the task - if it completes and the goal position has not been visited, then no path exists.

lelldorin

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • BeSly - Knowledge base
Re: Pipe Game
« Reply #2 on: 11. March 2018, 19:57:30 »
Thanks a lot, i will take a look  :)