// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Rosetta Code-inspired maze generator and solver. // Demonstrates use of interfaces to separate algorithm // implementations (graph.ShortestPath, heap.*) from data. // (In contrast, multiple inheritance approaches require // you to store their data in your data structures as part // of the inheritance.) package main import ( "bytes" "fmt" "math/rand" "time" "github.com/mattermost/rsc/rosetta/graph" ) type Maze struct { w, h int grid [][]walls } type Dir uint const ( North Dir = iota East West South ) type walls uint8 const allWalls walls = 1<