{"id":49072,"date":"2017-05-06T15:05:34","date_gmt":"2017-05-06T06:05:34","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=49072"},"modified":"2017-05-06T15:05:34","modified_gmt":"2017-05-06T06:05:34","slug":"maze-generator","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/maze-generator\/","title":{"rendered":"Maze generator - \u7570\u306a\u308b\u5f62\u72b6\u3001\u30b5\u30a4\u30ba\u306e\u8ff7\u8def\u3092\u4f5c\u6210\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2017\/04\/Is_20170426_150436.jpg\" alt=\"S 20170426 150436\" title=\"s_20170426_150436.jpg\" border=\"0\" width=\"1252\" height=\"799\" \/><\/p>\n<p>\u8ff7\u8def\u3068\u306f\u300c\u8907\u96d1\u306b\u5165\u308a\u7d44\u3093\u3060\u9053\u3092\u629c\u3051\u3066\u3001\u76ee\u7684\u5730\u3001\u30b4\u30fc\u30eb\u307e\u3067\u8fbf\u308a\u7740\u304f\u3053\u3068\u3092\u76ee\u6307\u3059\u30b2\u30fc\u30e0\u300d(by Wikipedia)\u3002<\/p>\n<p>\u4e00\u65b9\u3001\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/github.com\/razimantv\/mazegenerator\">Maze generator<\/a>\u300d\u306f\u3053\u306e\u8ff7\u8def\u306e\u753b\u50cf\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>C++\u3067\u4f5c\u3089\u308c\u3066\u3044\u3066\u3001\u8ff7\u8def\u306e\u30bf\u30a4\u30d7\u3084\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3001\u30b5\u30a4\u30ba\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u4e0e\u3048\u308b\u3068\u3001\u3055\u307e\u3056\u307e\u306a\u8ff7\u8def\u753b\u50cf\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u8ff7\u8def\u753b\u50cf\u306f\u6a19\u6e96\u3067svg\u5f62\u5f0f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001gnuplot\u304c\u5b58\u5728\u3059\u308c\u3070png\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u4ee5\u4e0b\u5177\u4f53\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>Maze generator\u306e\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>Maze generator\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306fC++11\u3067\u8a18\u8ff0\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u307b\u3069\u53e4\u304f\u306a\u3044C++\u30b3\u30f3\u30d1\u30a4\u30e9(g++\u7b49)\u3092\u5229\u7528\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070macOS\u74b0\u5883\u3067\u306f\u3001\u6a19\u6e96g++\u3092\u5229\u7528\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<pre>\ngit clone https:\/\/github.com\/razimantv\/mazegenerator.git\ncd mazegenerator\/src\nmake\n<\/pre>\n<p>\u25b2src\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b<span class=\"mybold\">mazegen<\/span>\u3068\u3044\u3046\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u3066\u3044\u308c\u3070\u30d3\u30eb\u30c9\u6210\u529f\u3067\u3059\u3002<\/p>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306a\u3057\u3067mazegen\u3092\u5b9f\u884c\u3059\u308b\u3068\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6b63\u65b9\u5f62\u306e\u8ff7\u8def\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>\n$ .\/mazegen\nRectangular maze of size 20x20\nMaze generation using Kruskal's algorithm\nInitialising graph...\nGenerating maze...\n<\/pre>\n<p>\u25b2\u300c20x20\u30b5\u30a4\u30ba\u300d\u306eRectangular maze\u300d\u3067\u300cKruskal\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u300d\u3092\u4f7f\u7528\u3057\u305f\u8ff7\u8def\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306bmaze.svg\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u66f8\u304d\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u306a\u3069\u3067\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5404\u7a2e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\n $ .\/mazegen -m 3 -a 1 -s 100\nCircular maze of size 100\nMaze generation using Depth-first search\nInitialising graph...\nGenerating maze...\nRendering maze to 'maze.svg'...\n<\/pre>\n<p>\u25b2\u300c100\u30b5\u30a4\u30ba\u300d\u306e\u300cCircular maze\u300d\u3067\u300c\u6df1\u3055\u512a\u5148\u63a2\u7d22\u300d\u3067\u8ff7\u8def\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u5404\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u8a73\u7d30\u306f\u4ee5\u4e0b\u306eUsage\u8868\u793a\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\nUsage: mazegen [--help] [-m <maze type>] [-a <algorithm type>]\n               [-s <size> | -w <width> -h <height>]\n               [-t <output type] [-o <output prefix>]\n\nOptional arguments\n  --help  Show this message and exit\n  -m      Maze type\n          0: Rectangular\n          1: Hexagonal (triangular lattice)\n          2: Honeycomb\n          3: Circular\n          4: Circular (triangular lattice)\n  -a      Algorithm type\n          0: Kruskal's algorithm\n          1: Depth-first search\n          2: Breadth-first search\n  -s      Size (non-rectangular mazes)\n  -w,-h   Width and height (rectangular maze)\n  -t      Output type\n          0: SVG output\n          1: png output using gnuplot (.plt) intermediate\n  -o      Prefix for .svg, .plt and .png outputs\n<\/pre>\n<p>\u25b2\"-m\"\u304c\u8ff7\u8def\u306e\u7a2e\u985e\u3001\"-a\"\u304c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7a2e\u985e\u3001\"-s\"\u304c\u8ff7\u8def\u306e\u30b5\u30a4\u30ba\u306a\u3069\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2017\/04\/Is_20170426_151005.jpg\" alt=\"S 20170426 151005\" title=\"s_20170426_151005.jpg\" border=\"0\" width=\"1116\" height=\"785\" \/><\/p>\n<p>\u25b2\u4f5c\u6210\u3055\u308c\u305fmaze.svg\u3092Safari\u3067\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Maze generator\u3092\u5229\u7528\u3059\u308c\u3070\u3055\u307e\u3056\u307e\u306a\u30bf\u30a4\u30d7\u306e\u8ff7\u8def\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8ff7\u8def\u597d\u304d\u306e\u65b9\u3001\u8ff7\u8def\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u4f7f\u7528\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8ff7\u8def\u3068\u306f\u300c\u8907\u96d1\u306b\u5165\u308a\u7d44\u3093\u3060\u9053\u3092\u629c\u3051\u3066\u3001\u76ee\u7684\u5730\u3001\u30b4\u30fc\u30eb\u307e\u3067\u8fbf\u308a\u7740\u304f\u3053\u3068\u3092\u76ee\u6307\u3059\u30b2\u30fc\u30e0\u300d(by Wikipedia)\u3002 \u4e00\u65b9\u3001\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300cMaze generator\u300d\u306f\u3053\u306e\u8ff7\u8def\u306e\u753b\u50cf\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":49291,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[3901],"class_list":["post-49072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-maze"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/49072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=49072"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/49072\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/49291"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=49072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=49072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=49072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}