[副本] map2data

作者: laechan (揮淚斬馬雲)   2014-04-19 17:44:57
justin 我看你已經寫好了,那因為你在斷線狀態,我補了一行
return map,用 running code 測試的結果如下:
tmp=@LONG
001-002 005-006
| | |
003-004 007
|
009-008
LONG
;
data="/std/new_ob/instance/instance_ob"->map2data(tmp);
write(identify(data)+"\n");
========== 程式執行區 ==========
([
"009" : ([ "east" : "008" ]),
"008" : ([ "west" : "009" ]), // 少了 north
"007" : ([ ]), // 少了 south north
"006" : ([ "west" : "005" ]), // 少了 south
"005" : ([ "east" : "006" ]), // 少了 south
"004" : ([ "west" : "003" ]), // 少了 north
"003" : ([ "east" : "004" ]), // 少了 north
"002" : ([ "west" : "001" ]), // 少了 south
"001" : ([ "east" : "002" ])
])
========== 程式執行區 ==========
這樣可以看出大概的問題,你可以再檢查一下,大抵上就是
map[t2]["north"] 跟 map[t2]["south"] 的判斷完全沒有執
行到,有執行到就會有資料,我加了 debug 行你可以參考
south 的判斷字串: [ | | |][ ]
south 的判斷字串: [ | | |][ | ]
south 的判斷字串: [ | | |][ | ]
south 的判斷字串: [ | | |][ |]
north 的判斷字串: [ | | |][ | ]
south 的判斷字串: [ |][ ]
north 的判斷字串: [ | | |][ | ]
south 的判斷字串: [ |][ ]
north 的判斷字串: [ | | |][ |]
south 的判斷字串: [ |][ |]
north 的判斷字串: [ |][ ]
north 的判斷字串: [ |][ |]
^^^^^^^^^^^^^^ ^^
t3 t3[a..b]
Laechan

Links booklink

Contact Us: admin [ a t ] ucptt.com