Public Class Form1
    Dim p As String = My.Computer.FileSystem.CurrentDirectory + "\"
    Sub PSR(ByVal fg As Short)
10:     Dim n As Short
20:     Randomize()
30:     n = Int(Rnd() * 3) + 1
40:     Select Case n   '電腦出拳
            Case 1 : PictureBox1.Load(p + "剪刀.jpg")
            Case 2 : PictureBox1.Load(p + "石頭.jpg")
            Case 3 : PictureBox1.Load(p + "布.jpg")
50:             End Select

        '請在此撰寫判斷輸贏的程式碼            
    End Sub

    Private Sub RadioButtons_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, RadioButton3.CheckedChanged
10:     Dim index As Short
20:     index = DirectCast(sender, RadioButton).TabIndex - 5
30:     Select Case index
            Case 1 : PictureBox2.Load(p + "剪刀.jpg")
            Case 2 : PictureBox2.Load(p + "石頭.jpg")
            Case 3 : PictureBox2.Load(p + "布.jpg")
40:             End Select
50:     Call PSR(index)
    End Sub
End Class
