[問題] Maze 迷宮C++

看板C_and_CPP作者 (UC大懶覺)時間7年前 (2016/08/26 02:16), 7年前編輯推噓2(207)
留言9則, 8人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) C++ (非本科系 請鞭小力一點) 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 用Disjoint sets 的Union 和 find. 來寫一個迷宮 1. 迷宮的格子 四個角 用 "+". 牆壁 用"|" 和 "-"來表示直的牆壁跟橫的牆壁 2. 用disjoint set 把迷宮開出一條最短路徑 有附上main function http://i.imgur.com/MTLLeJO.jpg
http://i.imgur.com/lrYHai6.jpg
http://i.imgur.com/952rglN.jpg
http://i.imgur.com/gFF4G9y.jpg
餵入的資料(Input): 1. Width (迷宮的橫行數。 2 height (迷宮的直行數。 width * height 就是m*n的迷宮 3 seed 用來輸入一個random number generator 預期的正確結果(Expected Output): 目前是有一些function 可以參考 但是演算法很複雜 從把迷宮牆壁 一個一個output 出來都很麻煩 用Union 跟 find 找出迷宮路徑時 用 Stack array 跟 vector來當工具 所以想上來請教一下有沒有簡單實用一點的方法? 這是我function 的大約藍圖 http://i.imgur.com/T9tqsrw.jpg
錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 168.150.0.17 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1472148973.A.A7E.html ※ 編輯: UCDaLanJiao (168.150.0.17), 08/26/2016 04:25:47

08/26 04:28, , 1F
我朋友之前寫的,可以參考 goo.gl/HbnB1l
08/26 04:28, 1F

08/26 04:37, , 2F
可以請問一下 sample out put 的 imapssl% 是什麼意
08/26 04:37, 2F

08/26 04:37, , 3F
思?
08/26 04:37, 3F

08/26 07:01, , 4F
Bfs dfs a* 迷宮 ,Google 應該有資料喔
08/26 07:01, 4F

08/26 08:35, , 5F
拍得不錯 不愧是MacBook
08/26 08:35, 5F

08/26 14:43, , 6F
樓上好酸xd
08/26 14:43, 6F

08/27 11:19, , 7F
Command Shift 4 可以截圖啦
08/27 11:19, 7F

08/27 22:17, , 8F
不愧是 Retina 螢幕
08/27 22:17, 8F

09/26 20:56, , 9F
附上網址不是很好嗎?
09/26 20:56, 9F
文章代碼(AID): #1NlpNjf- (C_and_CPP)