"Shorter path" procedure for a game... "Quori

Just BASIC Games
Post Reply
cassiope01
Posts: 56
Joined: Sat Jun 06, 2009 7:27 am
Location: FRANCE, Montpellier

"Shorter path" procedure for a game... "Quori

Post by cassiope01 »

Here we go !

I finally managed to write the Astar algorithm of pathfinding in JB.

In this case the goal is to find the shorter path between the GREEN pawn and the horizontal line where is the RED pawn.

To build a wall : select "Mur" and click in the crossing between cells,
every clic change the direction or erase it.
Attachments
AstarPCChemin.zip
(38.71 KiB) Downloaded 308 times
stpendl
Site Admin
Posts: 61
Joined: Wed Jan 18, 2006 10:05 pm
Location: Austria

Post by stpendl »

Nice demo, so the next program will be a maze :lol:
Stefan
The invisible Admin
cassiope01
Posts: 56
Joined: Sat Jun 06, 2009 7:27 am
Location: FRANCE, Montpellier

Post by cassiope01 »

Here is a version for a maze bigger than 9x9 cells.

maxi 99 x 99

A new important update. on 05/23/2010

Random walls generated. Diagonal possible. Showing work.

Subroutines name translated...

Increasing compute time... 06/05/2010
Attachments
Grille_25x25_optim.zip
(1.19 MiB) Downloaded 283 times
Last edited by cassiope01 on Sat Jun 05, 2010 11:36 am, edited 10 times in total.
tsh73
Posts: 46
Joined: Fri May 04, 2007 12:03 pm

Post by tsh73 »

It's very nice of yoour program to support save/load.
Here is a save that finds wrong path (where should not be one).
Attachments
25x25_06042010_133616.zip
save file of a problem
(277 Bytes) Downloaded 236 times
cassiope01
Posts: 56
Joined: Sat Jun 06, 2009 7:27 am
Location: FRANCE, Montpellier

Post by cassiope01 »

You were right tsh73, there was indeed a small bug : corrected.

You can double click on the board and see what append :D


Here is a new one to compare Joseph E's AStar algorithm code... and a mix with Janet's Maze generator...
Attachments
PathFinder_Astar.zip
(8.1 KiB) Downloaded 275 times
Post Reply