package main
+import "flag"
import "fmt"
import "os"
+import "reflect"
import "strconv"
+import "github.com/petar/GoLLRB/llrb"
+import "github.com/willf/bloom"
+
+var bloomsize = flag.Int("bloomsize", 2000000, "Size bloomfilter for this many states.")
+
const HOLE = 0
const BOARD_DIM = 4
const BOARD_SIZE = BOARD_DIM * BOARD_DIM
type Space int8
type Board [BOARD_SIZE]Space
+type Step struct {
+ board Board
+ prev *Step
+ length int
+}
const (
LEFT = -1
return adjacent
}
+func create_successors(start *Step) {
+ for _, adj := adjacent_spaces(start.
+}
+
+func sliding_tile(start *Board) error {
+ seen := bloom.NewWithEstimates(uint(*bloomsize), 0.0001)
+ seen.Add(reflect.ValueOf(*start).Bytes())
+ return nil
+}
+
func main() {
- start, err := read_board_from_strings(os.Args[1:])
+ flag.Parse()
+ start, err := read_board_from_strings(flag.Args())
+ if err != nil {
+ fmt.Println(err)
+ os.Exit(1)
+ }
+ err = sliding_tile(start)
if err != nil {
- panic(err)
+ fmt.Println(err)
+ os.Exit(1)
}
- fmt.Println(start)
}