Given the square area floor with available and unavailable route. Given the position of the person in the area. There is a missing object in the area and the person is look forward the object with given clue direction.
This is what implemented in `main.go`
########
#......#
#.###..#
#...#.##
#o#....#
########
*details:
# is the wall
. is available route
o is person position
This is what implemented in `main.go`
1. Going North
2. Going East
3. Going South
$ go run main.go
*NOTE:
- you can modify the input on
main.go
file either thefloor
,person pos
and theclue
as well. - the program has 2 method for the solution and implemented 1 of them. the first method is
conventional nested loop
and the other one isrecursive method
which implemented by default. both method working properly. the different is the recursive one is more flexible for the direction input.
Hirzi Nurfakhrian
1.0.0