1 / 14

# 計算機程式及實習 期末報告 PPT 製作 - PowerPoint PPT Presentation

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about '計算機程式及實習 期末報告 PPT 製作' - erica-dale

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### 計算機程式及實習期末報告PPT製作

• 先按下 電腦會隨機亂數發放二張卡牌，之後由右邊那張是玩家的卡片，電腦會由卡牌大小來判定玩家是贏還輸。
• 若所選的生肖大，會顯示“ 你贏了 ! 按發牌鈕 重玩 ...."
• 若所選的生肖大小相同，會顯示“ 平手 ! 按發牌鈕 重玩 ...."
• 若所選的生肖小，會顯示“ 你輸了 ! 按發牌鈕 重玩 ...."
• 鼠牌最小，圖騰牌最大。

• Public Class Form1
• Dim num1, num2 As Integer
• Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
• pic1.Enabled = False
• pic2.Enabled = False
• pic1.SizeMode = PictureBoxSizeMode.AutoSize
• pic2.SizeMode = PictureBoxSizeMode.AutoSize
• pic1.Image = New Bitmap("Pokerbk.jpg")
• pic2.Image = New Bitmap("Pokerbk.jpg")
• lblMsg.Text = "十二生肖比大小 發牌鈕遊戲開始.."
• End Sub

Private Sub btnShuffle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShuffle.Click

• pic1.Enabled = True
• pic2.Enabled = True
• btnShuffle.Enabled = False
• pic1.Image = New Bitmap("Pokerbk.jpg")
• pic2.Image = New Bitmap("Pokerbk.jpg")
• Randomize()
• num1 = Int(Rnd() * 13) + 1
• num2 = Int(Rnd() * 13) + 1
• lblMsg.Text = "請在撲克牌上按一下選取 .."
• End Sub

Private Sub pic1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic1.Click

• pic1.Image = New Bitmap("Poker" & num1 & ".jpg")
• pic2.Image = New Bitmap("Poker" & num2 & ".jpg")
• If num1 > num2 Then
• lblMsg.Text = " 你贏了 ! 按發牌鈕 重玩 ...."
• Else
• If num1 = num2 Then
• lblMsg.Text = " 平 手 ! 按發牌鈕 重玩 ...."
• Else
• lblMsg.Text = " 你輸了 ! 按發牌鈕 重玩 ...."
• End If
• End If
• pic1.Enabled = False
• pic2.Enabled = False
• btnShuffle.Enabled = True
• End Sub

Private Sub pic2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic2.Click

• pic1.Image = New Bitmap("Poker" & num1 & ".jpg")
• pic2.Image = New Bitmap("Poker" & num2 & ".jpg")
• If num2 > num1 Then
• lblMsg.Text = " 你贏了 ! 按發牌鈕 重玩 ...."
• Else
• If num2 = num1 Then
• lblMsg.Text = " 平 手 ! 按發牌鈕 重玩 ...."
• Else
• lblMsg.Text = " 你輸了 ! 按發牌鈕 重玩 ...."
• End If
• End If
• pic1.Enabled = False
• pic2.Enabled = False
• btnShuffle.Enabled = True
• End Sub

Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click

• End
• End Sub
• End Class

• 先點選發牌鈕 再點選上隨一圖片

1.Visual Basic 2010基礎必修課

2.上課教材PTT