Пример #1
0
Файл: icarus.go Проект: mouk/gc6
//execute move take a possible move to execute,
//keep track of it in the breadcrumbs and update coordination
func executeMove(move string, breadcrumbs *mazelib.Stack, visited map[mazelib.Coordinate]bool, co mazelib.Coordinate) (mazelib.Survey, mazelib.Coordinate, error) {
	//add the reverse move to the breadcrumbs stack
	breadcrumbs.Push(move)
	//perform the move
	survey, err := Move(move)
	//mark the new room as visited
	co = co.TranformByMove(move)
	visited[co] = true
	return survey, co, err
}