看板 Soft_Job 關於我們 聯絡資訊
※ 引述《viable (viable)》之銘言: : 這版上諸多經驗豐富的高手, : 讓小妹向各位請教一個問題。 : 小妹最近翻出一個程式, : 其中有一”坨”由好幾個迴圈和if堆疊而成 : {{{{ : {} : {} : {} : { : {} : {} : } : }}}} : 夾雜一堆變數和三、四維陣列,弄得小妹頭昏眼花 : 小妹想了解如何改寫會更簡潔明嘹 請問是長這樣嗎?不是的話可以請你標出是 for block 還是 if block 嗎? for (ecx = 0; ecx < edx; ecx++) { for (cx = 0; cx < dx; cx++) { for (ch = 0; ch < dh; ch++) { if ( whatever ) { if ( condition unu ) { do this; } if ( condition du ) { do that; } if ( condition tri ) { clean up; } for (cl = 0; cl < dl; cl++) { if ( condition kvar ) { handle this; } if ( condition kvin ) { handle that; } } } } } } -- Oni devas ami animalojn. Ili estas tiel bongustaj. One should love animals. They are so tasty. 每個人都應該愛動物,他們是如此美味。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.180.46.114
edward13:推你熱心 還幫原po寫pseudo code 07/17 12:51