From 33bb98f505ab425f693f1e8a6a1bb694a83dff92 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 1 Jan 2016 21:55:10 -0800 Subject: [PATCH] Done with this tool 64: 0 12 13 10 15 11 9 14 7 4 6 5 3 8 1 2 64: 15 12 13 9 0 11 10 14 4 8 1 6 3 7 5 2 64: 12 15 14 10 0 11 9 13 7 3 6 5 4 8 2 1 64: 15 12 13 10 11 0 14 9 4 3 5 1 8 7 2 6 64: 12 0 10 9 11 15 14 13 7 4 1 6 8 3 5 2 64: 11 0 9 10 15 12 14 13 3 7 2 5 4 8 6 1 64: 11 0 10 13 12 15 9 14 3 4 2 1 7 8 6 5 64: 11 0 13 9 15 12 10 14 7 8 5 1 4 3 2 6 64: 12 0 14 9 15 11 13 10 3 7 6 2 8 4 1 5 64: 12 0 13 10 11 15 9 14 8 3 1 2 4 7 5 6 64: 12 11 10 13 15 0 9 14 8 4 2 6 7 3 1 5 64: 0 15 9 13 11 12 14 10 4 3 2 6 7 8 5 1 64: 15 11 14 10 0 12 9 13 4 7 5 2 3 8 1 6 --- find_long_distance_boards.cc | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 find_long_distance_boards.cc diff --git a/find_long_distance_boards.cc b/find_long_distance_boards.cc deleted file mode 100644 index 22c6c2e..0000000 --- a/find_long_distance_boards.cc +++ /dev/null @@ -1,34 +0,0 @@ -#include "sliding_tile_lib.h" -#include "gflags/gflags.h" - -#include -#include - -int main(int argc, char** argv) { - gflags::ParseCommandLineFlags(&argc, &argv, false); - - Board goal{{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}}; - InvertedBoard invgoal = goal.invert(); - - Board rev{{0,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}}; - std::cout << rev.distance(invgoal) << ": " << rev << std::endl; - - std::random_device rd; - std::mt19937 rng(rd()); - - int max_distance = 0; - while (true) { - Board b{{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; - for (int i = 0; i < BOARD_SIZE; i++) { - std::uniform_int_distribution<> get_random_number(0, i); - std::swap(b.board[i], b.board[get_random_number(rng)]); - } - int dist = b.distance(invgoal); - if (dist > max_distance) { - max_distance = dist; - } - if (dist > max_distance - 2) { - std::cout << dist << ": " << b << std::endl; - } - } -} -- 2.44.1