diff --git a/Sources/A-Star/A_Star.swift b/Sources/A-Star/A_Star.swift index 50097da..a7fba0c 100644 --- a/Sources/A-Star/A_Star.swift +++ b/Sources/A-Star/A_Star.swift @@ -30,9 +30,10 @@ the grid. Controls: - Cursor movement: WASD, HJKL, or Arrow Keys -- Wall placement: Space -- Origin movement: [ -- Target movement: ] +- Place wall: Space +- Place start: [ +- Place goal: ] +- Restrict valid movement options: number keys (directions based on number pad) """#) print("Enter the grid width: ", terminator: "") @@ -71,6 +72,8 @@ Controls: cursorPosition += Vector2(x: 0, y: 1) default: switch key { + case .Quit: + quit() case .Start: start = cursorPosition case .Finish: @@ -231,21 +234,21 @@ Controls: var output: String = "" output += draw["nw"] ?? "?" - output += String(repeating: draw["n"] ?? "?", count: on[0].count) + output += String(repeating: draw["n"] ?? "?", count: on[0].count + 2) output += draw["ne"] ?? "?" output += "\n" for y: Int in 0..