Yes I know we already have visual basic examples, but I used qbasic, and more is always better. (Except in the case of fertilizer...)
So I've been programming on Qbasic because I can write basic programs on my palm, and it's much easier to debug on the computer.
I've finally figured out the wavefront, and I figured I'd share my EXTREMELY SLOPPY code.
But read these few things first.
- I'm going to make it prettier...
- I'm going to make it more efficient...
- I don't know how to pass a 2d array to a subroutine so I can't use them (I even tried googling it)
- You'll have to download qbasic to make it work (it's like 257 Kb lol)
My program lets you pick the size of the array, pick the robot location and goal location.
I have no idea if I'm doing a recursive or normal wavefront...
I just followed admins pseudo code on the wavefront page.
My program takes any size array and outputs the array to wave.dat probably wherever the wavefron.bas file is located (or just C:, I have no idea)
And I think I want my poor little palm to do way to much. Right now I have a 150x150 array set up on it for my robot to go through.
It took my computer 5 or 8 or so seconds to go through a 60x60 array. My palm wouldn't have a chance. lol I guess I need to think smaller.
So, without further adieu, here's my (terribly programed) file. (And I've included basic with it, not sure if that's legal or not... whatever, qbasic is free)http://www.box.net/shared/g3v7dcuu189xs7z1e0jm
Oh, you can open the wavefron.bas file in notepad, in case you don't feel like looking at it in qbasic.