作者MOONRAKER (㊣烏笨禿,又笨又禿)
看板Visual_Basic
標題Re: [VB6 ] 井字遊戲的勝負判定
時間Sat May 17 11:10:32 2008
: 推 xtimer:阿哩...看了兩個小時....還是看不懂= =
: → xtimer:好複雜~@@
沒概念就硬幹啦,不要自找麻煩了
if button1.text = button2.text and button 2.text=button3.text then
...
else if button4.text = button5.text and button5.text=button6.text then
...
else if ...
...
end if
才八個狀況,八組判斷,一共就16項,有什麼好怕的
一開始沒寫陣列,現在加上去也不會比較簡單
有陣列也只是好一點而已
if tictac(0,0) = tictac(0,1) and tictac(0,1) = tictac(0,2) then
...
else if tictac(1,0) = tictac(1,1) and tictac(1,1) = tictac(1,2) then
...
else if ...
...
end if
新手不用想那麼多,硬幹出來就對了
等你硬幹到很煩很煩的時候,自然會體會出其他tricky的寫法
--
Batch 2 update (5/10) -
西班牙宗教審訊 -
主教 -
地獄阿婆 -
AND LOTS MORE
Unleashed Pythonesque pleasure, fully l10n'ed for Traditional Chinese
Spam-a-lot and prosper with the Monty Python!
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
■ 蒙帝派松正體中文計畫 ■ http://www.youtube.com/user/JamesBondXD
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.115.206.108
推 icehunter:推 05/17 14:12
推 weibld:以前我寫不出來都是用硬幹的 = ="。反正程式小,跑起來也快 05/29 13:01
→ MOONRAKER:硬幹出來其實也沒多長,但是想的時候總覺得很長很難 XD 06/03 23:09