Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shortest Path Algorithm in (Turbo)Pascal?
#10
Here:

All vars with P=Player, R=Rat

Code:
cls
screen 13


dx!=rx-px
dy!=ry-py

Leng!=(Dx!*dx!)+(dy!*dy!)
Leng!=Sqr(Leng!)

dx!=dx!/Leng!
dy!=dy!/Leng!

sx!=px
sy!=py
For I=0 to Leng!
        
      sx!=sx!+dx!
      sy!=sy!+dy!
      Pset(sx!,sy!),15

Next I
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply


Messages In This Thread
Shortest Path Algorithm in (Turbo)Pascal? - by relsoft - 07-01-2003, 09:07 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)