Noops Week Two: Mazebot discussion

This is a space to share and discuss with your fellow challengers. Feel free to post comments below and start the conversation. Good luck challengers!

Here’s my naive implementation of maze racer solver mazebot.rb in ruby which is a translation from my js implementation maze-solver.js.

First time doing ruby, don’t think I can get used to that syntax :expressionless:

I’ve started a bit too late but here is my solution is written in Go. I decided that these challenges are a great opportunity to sharpen my Go programming skills. Not too difficult, not too simple, just right :slight_smile:

The solution is straightforward: it uses A-star with Manhatten heuristic. However, it was a great challenge for someone who is trying to get a grasp of a new language, and I am glad that I was able to implement it in a couple of days.

Here is the core function of the implementation:

func Solve(m *generator.Maze, h Heuristic) *Vertex {
	queue := collections.PriorityQueue{NewVertex(m.Start)}
	goal := NewVertex(m.Exit)
	visited := map[generator.Point]bool{}
	for !queue.Empty() {
		curr := queue.Pop().(*Vertex)
		visited[curr.Point] = true
		if curr.Equal(goal) {
			return curr
		for _, neighbour := range getNeighbours(m, curr) {
			_, wasVisited := visited[neighbour.Point]
			if wasVisited { continue }
			neighbour.Score = h(neighbour, goal)
	return nil

Also, I’ve created a little “renderer” to visualize a maze using ASCII chars.

Would be great if these bot APIs will be available after the challenge ends!

I had some fun and some challenge with this one.

After completing the challenge, do I set up a pull request? Or do I just post my certificate?