1 / 10

井字 遊戲

ooxx 這個 遊戲 程式 ,非常的簡單 只要 你 小時候會玩 井字遊戲 即可把電腦打敗,可以 說 是一種考智力取勝的 遊戲。. 井字 遊戲. 進到畫面會 看到玩家一先點會是 o 玩家二點會是 x ! 然後 就 照著小時候的玩法玩囉 ~ 玩到最後 他 會顯示 出 是玩家一還是玩家二獲勝 ,如果輸的玩家想雪恥,就點擊再一次,便可繼續挑戰了。. 系統功能說明. 表單設計. 沙包圖片檔. Public Class Form1 Dim a, b, c

fathia
Download Presentation

井字 遊戲

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ooxx這個遊戲程式,非常的簡單只要你小時候會玩井字遊戲即可把電腦打敗,可以說是一種考智力取勝的遊戲。ooxx這個遊戲程式,非常的簡單只要你小時候會玩井字遊戲即可把電腦打敗,可以說是一種考智力取勝的遊戲。 井字遊戲

  2. 進到畫面會看到玩家一先點會是o玩家二點會是x!進到畫面會看到玩家一先點會是o玩家二點會是x! 然後就照著小時候的玩法玩囉~玩到最後他會顯示出是玩家一還是玩家二獲勝,如果輸的玩家想雪恥,就點擊再一次,便可繼續挑戰了。 系統功能說明

  3. 表單設計

  4. 沙包圖片檔

  5. Public Class Form1Dim a, b, c Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadMsgBox("第A一位玩家是O,第二位玩家是X") a = 0 End Sub 程式碼設計

  6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click a = a + 1 b = a Mod 2 If b = 1 Then Button1.Text = "O" If Button2.Text = "O" And Button3.Text = "O" Then MsgBox("玩家一贏了!!") ElseIf Button5.Text = "O" And Button9.Text = "O" Then MsgBox("玩家一贏了!!") ElseIf Button4.Text = "O" And Button7.Text = "O" Then MsgBox("玩家一贏了!!") End If

  7. ElseIf b = 0 Then Button1.Text = "X" If Button2.Text = "X" And Button3.Text = "X" Then MsgBox("玩±家a二G 贏1了F!!") ElseIf Button5.Text = "X" And Button9.Text = "X" Then MsgBox("玩±家a二G 贏1了F!!") ElseIf Button4.Text = "X" And Button7.Text = "X" Then MsgBox("玩±家a二G 贏1了F!!") End If End If End Sub

  8. 實際執行程式圖

  9. 這次的作業我是照著課本8.9.10.15章節來寫遊戲程式,對VB不是很瞭解,但就是怎樣都有錯誤,所以我才放棄,叫別人教我最簡單的遊戲程式,以前高中電腦課也沒自己寫過Basic的程式,很多語法、method都不太會用,書上寫得也蠻有限,因此我要看著Visual Basic的書,才知道怎麼寫,但不一定明白是啥意思,總之我覺得VB滿難的。 心得

  10. 參考文獻 • Visual Basic 2010 基礎必修課

More Related