Webeginthesearchbydoingthefollowing:
1.Beginningatthestartingpoint,itwasaddedtoan“openlist”i.ethelistofsquaresthatneedtobecheckedout.
2.allthereachablesquaresadjacenttothestartingpointwerealsoaddedtotheopenlist.Foreachofthesesquares,thefirstsquarewassavedasits“parentsquare”.
3.Thestartingsquarewasdroppedfromtheopenlistandaddedtothe“closedlist”i.elistofsquaresthatdon’tneedtobelookedatagainpresently.
Theequationusedforfiguringoutthepathwas:F=G+H
•G=themovementcosttomovefromthestartingpointtoagivensquareonthegrid
•H=theestimatedmovementcosttomovefromthatgivensquareonthegridtothefinaldestination
ThepathwasgeneratedbyrepeatedlygoingthroughouropenlistandchoosingthesquarewiththelowestFscore.Hereacostof10wasassignedtoeachhorizontalorverticalsquaremoved,andacostof14foradiagonalmove.