func solve() bool {
	var last, n int
	for pos, field := range board {
		if field == '●' {
			for _, dir := range [...]int{-1, -N, +1, +N} {
				if move(pos, dir) {
					if solve() {
						unmove(pos, dir)
						println(string(board))
						return true
					}
					unmove(pos, dir)
				}
			}
			last = pos
			n++
		}
	}
	if n == 1 && (center < 0 || last == center) {
		println(string(board))
		return true
	}
	return false
}
solve tries to find a sequence of moves such that there is only one peg left
at the end; if center is >= 0, that last peg must be in the center position.
If a solution is found, solve prints the board after each move in a backward
fashion (i.e., the last board position is printed first, all the way back to
the starting board position).
package main
const N = 11 + 1  
var board = []rune(
	`...........
...........
....●●●....
....●●●....
..●●●●●●●..
..●●●○●●●..
..●●●●●●●..
....●●●....
....●●●....
...........
...........
`)
var center int
func init() {
	n := 0
	for pos, field := range board {
		if field == '○' {
			center = pos
			n++
		}
	}
	if n != 1 {
		center = -1  
	}
}
var moves int  
func move(pos, dir int) bool {
	moves++
	if board[pos] == '●' && board[pos+dir] == '●' && board[pos+2*dir] == '○' {
		board[pos] = '○'
		board[pos+dir] = '○'
		board[pos+2*dir] = '●'
		return true
	}
	return false
}
func unmove(pos, dir int) {
	board[pos] = '●'
	board[pos+dir] = '●'
	board[pos+2*dir] = '○'
}