///|
pub fn export_ascii(
grid : GridMap,
start~ : Position,
goal~ : Position,
trace? : SearchTrace,
) -> String {
let path = match trace {
Some(t) => t.result.path
None => []
}
let last_step = match trace {
Some(t) => t.steps.last()
None => None
}
let visited = match last_step {
Some(step) => step.visited
None => []
}
let frontier = match last_step {
Some(step) => step.frontier
None => []
}
let out = StringBuilder()
for y in 0.. Char {
if position == start {
'S'
} else if position == goal {
'E'
} else if grid.is_obstacle(position) {
'#'
} else if path.contains(position) {
'*'
} else if frontier.contains(position) {
'F'
} else if visited.contains(position) {
'.'
} else {
' '
}
}