Skip to content

Commit 8b439f4

Browse files
Sebastian LagueSebastian Lague
authored andcommitted
Added pseudocode
1 parent 3e76da7 commit 8b439f4

597 files changed

Lines changed: 21 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Episode 01 - pseudocode/Pseudocode

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
OPEN //the set of nodes to be evaluated
2+
CLOSED //the set of nodes already evaluated
3+
add the start node to OPEN
4+
5+
loop
6+
current = node in OPEN with the lowest f_cost
7+
remove current from OPEN
8+
add current to CLOSED
9+
10+
if current is the target node //path has been found
11+
return
12+
13+
foreach neighbour of the current node
14+
if neighbour is not traversable or neighbour is in CLOSED
15+
skip to the next neighbour
16+
17+
if new path to neighbour is shorter OR neighbour is not in OPEN
18+
set f_cost of neighbour
19+
set parent of neighbour to current
20+
if neighbour is not in OPEN
21+
add neighbour to OPEN
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)