Dim Imageadress0 As String
Dim ImageAdress(1 To 20) As String
Dim k(1 To 20) As Integer
Dim r(1 To 20) As Double
Dim Flag As Integer '1枚め:Flag=1,2枚め:Flag=2
Dim People As String 'People="うさぎ",People="くま"
Dim Memo As String '画像のアドレス
Dim Tokuten1 As Integer 'うさぎの得点
Dim Tokuten2 As Integer 'くまの得点
Dim Card1 As Control '1枚目のカードの画像
Dim Card2 As Control '2枚目のカードの画像
Dim FlagOK As Integer '絵が一致した時:値1、初期値0
Private Sub ClearButton_Click()
FlagOK = 0
Imageadress0 = "Image0.jpg" '絵の無い無地の画像ファイル
Card01.Picture = LoadPicture(Imageadress0)
Card02.Picture = Card01.Picture
Card03.Picture = Card01.Picture
Card04.Picture = Card01.Picture
Card05.Picture = Card01.Picture
Card06.Picture = Card01.Picture
Card07.Picture = Card01.Picture
Card08.Picture = Card01.Picture
Card09.Picture = Card01.Picture
Card10.Picture = Card01.Picture
Card11.Picture = Card01.Picture
Card12.Picture = Card01.Picture
Card13.Picture = Card01.Picture
Card14.Picture = Card01.Picture
Card15.Picture = Card01.Picture
Card16.Picture = Card01.Picture
Card17.Picture = Card01.Picture
Card18.Picture = Card01.Picture
Card19.Picture = Card01.Picture
Card20.Picture = Card01.Picture
End Sub
Private Sub OKButton_Click()
Imageadress0 = "Image0.jpg" '絵の無い無地の画像ファイル
Text4.Text = " "
Text5.Text = " "
If FlagOK = 0 Then
Card1.Picture = LoadPicture(Imageadress0)
Card2.Picture = LoadPicture(Imageadress0)
End If
FlagOK = 0
End Sub
Private Sub ResetButton_Click()
Dim N As Integer
N = 20
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Imageadress0 = "Image0.jpg" '絵の無い無地の画像ファイル
Card01.Picture = LoadPicture(Imageadress0)
Card02.Picture = Card01.Picture
Card03.Picture = Card01.Picture
Card04.Picture = Card01.Picture
Card05.Picture = Card01.Picture
Card06.Picture = Card01.Picture
Card07.Picture = Card01.Picture
Card08.Picture = Card01.Picture
Card09.Picture = Card01.Picture
Card10.Picture = Card01.Picture
Card11.Picture = Card01.Picture
Card12.Picture = Card01.Picture
Card13.Picture = Card01.Picture
Card14.Picture = Card01.Picture
Card15.Picture = Card01.Picture
Card16.Picture = Card01.Picture
Card17.Picture = Card01.Picture
Card18.Picture = Card01.Picture
Card19.Picture = Card01.Picture
Card20.Picture = Card01.Picture
For i = 1 To N
k(i) = i
r(i) = Rnd
Next i
For i = 1 To N - 1
For j = 1 To N - i
If r(j) > r(j + 1) Then
kk = k(j)
k(j) = k(j + 1)
k(j + 1) = kk
rr = r(j)
r(j) = r(j + 1)
r(j + 1) = rr
End If
Next j
Next i
FlagOK = 0
Flag = 1 '初期値
Tokuten1 = 0 '初期値
Tokuten2 = 0 '初期値
Text1.Text = Tokuten1
Text2.Text = Tokuten2
People = "うさぎ" '初期値
End Sub
Private Sub Form_Load()
Dim N As Integer
N = 20
For i = 1 To N
k(i) = i
r(i) = Rnd
Next i
For i = 1 To N - 1
For j = 1 To N - i
If r(j) > r(j + 1) Then
kk = k(j)
k(j) = k(j + 1)
k(j + 1) = kk
rr = r(j)
r(j) = r(j + 1)
r(j + 1) = rr
End If
Next j
Next i
FlagOK = 0
Flag = 1 '初期値
Tokuten1 = 0 '初期値
Tokuten2 = 0
Text1.Text = Tokuten1
Text2.Text = Tokuten2
Text1.Text = 0 '初期値
People = "うさぎ" '初期値
Imageadress0 = "Image0.jpg" '絵の無い無地の画像ファイル
ImageAdress(1) = "Image1.jpg"
ImageAdress(2) = "Image1.jpg"
ImageAdress(3) = "Image2.jpg"
ImageAdress(4) = "Image2.jpg"
ImageAdress(5) = "Image3.jpg"
ImageAdress(6) = "Image3.jpg"
ImageAdress(7) = "Image4.jpg"
ImageAdress(8) = "Image4.jpg"
ImageAdress(9) = "Image5.jpg"
ImageAdress(10) = "Image5.jpg"
ImageAdress(11) = "Image6.jpg"
ImageAdress(12) = "Image6.jpg"
ImageAdress(13) = "Image7.jpg"
ImageAdress(14) = "Image7.jpg"
ImageAdress(15) = "Image8.jpg"
ImageAdress(16) = "Image8.jpg"
ImageAdress(17) = "Image9.jpg"
ImageAdress(18) = "Image9.jpg"
ImageAdress(19) = "Image10.jpg"
ImageAdress(20) = "Image10.jpg"
End Sub
Private Sub Card01_Click()
Card01.Picture = LoadPicture(ImageAdress(k(1)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card01
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(1)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card01
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(1)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card02_Click()
Card02.Picture = LoadPicture(ImageAdress(k(2)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card02
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(2)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card02
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(2)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card03_Click()
Card03.Picture = LoadPicture(ImageAdress(k(3)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card03
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(3)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card03
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(3)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎさん"
Text3.Text = "次もうさぎさん"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くまさん"
Text3.Text = "次もくまさん"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎさん"
Text3.Text = "次はくまさんです"
Else
People = "うさぎ"
Text4.Text = "くまさん"
Text3.Text = "次はうさぎさんです"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card04_Click()
Card04.Picture = LoadPicture(ImageAdress(k(4)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card04
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(4)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card04
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(4)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうです"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくまです"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくまです"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさんです"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card05_Click()
Card05.Picture = LoadPicture(ImageAdress(k(5)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card05
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(5)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card05
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(5)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card06_Click()
Card06.Picture = LoadPicture(ImageAdress(k(6)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card06
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(6)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card06
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(6)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くまさん"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card07_Click()
Card07.Picture = LoadPicture(ImageAdress(k(7)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card07
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(7)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card07
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(7)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card08_Click()
Card08.Picture = LoadPicture(ImageAdress(k(8)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card08
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(8)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card08
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(8)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card09_Click()
Card09.Picture = LoadPicture(ImageAdress(k(9)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card09
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(9)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card09
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(9)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card10_Click()
Card10.Picture = LoadPicture(ImageAdress(k(10)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card10
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(10)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card10
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(10)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card11_Click()
Card11.Picture = LoadPicture(ImageAdress(k(11)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card11
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(11)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card11
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(11)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card12_Click()
Card12.Picture = LoadPicture(ImageAdress(k(12)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card12
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(12)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card12
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(12)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card13_Click()
Card13.Picture = LoadPicture(ImageAdress(k(13)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card13
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(13)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card13
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(13)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card14_Click()
Card14.Picture = LoadPicture(ImageAdress(k(14)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card14
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(14)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card14
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(14)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card15_Click()
Card15.Picture = LoadPicture(ImageAdress(k(15)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card15
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(15)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card15
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(15)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card16_Click()
Card16.Picture = LoadPicture(ImageAdress(k(16)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card16
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(16)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card16
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(16)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card17_Click()
Card17.Picture = LoadPicture(ImageAdress(k(17)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card17
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(17)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card17
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(17)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card18_Click()
Card18.Picture = LoadPicture(ImageAdress(k(18)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card18
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(18)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card18
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(18)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card19_Click()
Card19.Picture = LoadPicture(ImageAdress(k(19)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card19
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(19)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card19
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(19)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub Card20_Click()
Card20.Picture = LoadPicture(ImageAdress(k(20)))
If Flag = 1 Then '1枚目なら
Set Card1 = Card20
Flag = 2 'Flagを1(2枚目)にして
Memo = ImageAdress(k(20)) '1枚めの画像を記憶する
Else '2枚目なら
Set Card2 = Card20
Flag = 1 'Flagを2(1枚目)に戻して
If Memo = ImageAdress(k(20)) Then '1枚目の画像と比較して、同じなら
If People = "うさぎ" Then '競技者の得点を加算して表示する
Tokuten1 = Tokuten1 + 1
Text1.Text = Tokuten1
Text4.Text = "うさぎ"
Text3.Text = "次もうさぎ"
Else
Tokuten2 = Tokuten2 + 1
Text2.Text = Tokuten2
Text4.Text = "くま"
Text3.Text = "次もくま"
End If
Text5.Text = "おめでとう"
FlagOK = 1
Else '同じでないなら
If People = "うさぎ" Then '競技者を交代して
People = "くま"
Text4.Text = "うさぎ"
Text3.Text = "次はくま"
Else
People = "うさぎ"
Text4.Text = "くま"
Text3.Text = "次はうさぎ"
End If
Text5.Text = "残念でした"
End If
End If
End Sub
Private Sub EndButton_Click()
End
End Sub