ハルhal
デジタル コンテンツ

pc2

作って学ぶ
ハードとソフト

アルゴリズム
電子回路

 






このサイトはHPです
ブログではありません
要望・意見は
下記の掲示場を利用して
下さいまたブログも見て下さい

 

ロボット・DOSV掲示板兼Blog

懐かしのコンピュータ
Apple II Apple2
PC9801 PC9821

roboto

Topに戻る

ララ Lara
アナログ コンテンツ

Lara座れ
動画で学ぶ
躾と訓練
動画メニュー


工作


集団練習メニュー


しつけ 訓練コラム




最後にララについて

このサイトはHPです
ブログではありません
要望・意見は
下記の掲示場を利用して
下さいまたブログも見て下さい

Laraララの
ブログ

犬のしつけと訓練
掲示板


掲示板の利用規則

 

 

 

 

Lara伏せ
Topに戻る
松本 ワンワンクラブ
わんわんクラブ

 

VBAでカードゲームを作る 
神経衰弱ゲーム2

トランプの裏を表示します。コマンドボタン2をダブルクリックして次のプログラムを入れる

Private Sub CommandButton2_Click()
Image1.Picture = Image28.Picture
Image2.Picture = Image28.Picture
Image3.Picture = Image28.Picture
Image4.Picture = Image28.Picture
Image5.Picture = Image28.Picture
Image6.Picture = Image28.Picture
Image7.Picture = Image28.Picture
Image8.Picture = Image28.Picture
Image9.Picture = Image28.Picture
Image10.Picture = Image28.Picture
Image11.Picture = Image28.Picture
Image12.Picture = Image28.Picture
Image13.Picture = Image28.Picture

End Sub

実行 裏面が表示される


Private Sub CommandButton2_Click()
Image1.Picture = Image28.Picture
Image2.Picture = Image28.Picture
Image3.Picture = Image28.Picture
Image4.Picture = Image28.Picture
Image5.Picture = Image28.Picture
Image6.Picture = Image28.Picture
Image7.Picture = Image28.Picture
Image8.Picture = Image28.Picture
Image9.Picture = Image28.Picture
Image10.Picture = Image28.Picture
Image11.Picture = Image28.Picture
Image12.Picture = Image28.Picture
Image13.Picture = Image28.Picture
no = 1
x = no
kotae = no
disp2
Image14.Picture = Image29.Picture

End Sub

1が表示される


判定ルーチン イメージ1をクリックしたときの判定を造る

Private Sub Image1_Click()
Image1.Visible = False
If a(1) = kotae Then
Image1.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image1.Visible = True

End Sub

Sub seikai()
TextBox1 = "正解です"
no = no + 1
x = no
kotae = no
disp2
Image14.Picture = Image29.Picture
ok = ok + 1
If ok = 13 Then
TextBox1 = "完璧 ゲームクリアー"
iq = iq + 20
CommandButton2_Click
End If
End Sub

Sub missdesu()
TextBox1 = "間違え"
miss = miss + 1
If miss > 2 Then
iq = iq - 20
TextBox2 = iq
TextBox1 = "GAME OVER はじめから"
CommandButton2_Click
Else
End If
End Sub
Private Sub userform_initialize()
iq = 80
End Sub

実行 左上1番目に1【クラブのエース】が出るまでボタン1「覚えてね」をクリックする。クラブのエースが出たら
ボタン2「はじめ」その絵【クラブのエース】をクリックする。


Private Sub Image1_Click()
Image1.Visible = False
If a(1) = kotae Then
Image1.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image1.Visible = True
End Sub

上記の部分をコピーして12個貼り付け、赤字の部分を直す。
Private Sub Image2_Click()
Image2.Visible = False
If a(2) = kotae Then
Image2.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image2.Visible = True
End Sub

Private Sub Image3_Click()
Image3.Visible = False
If a(3) = kotae Then
Image3.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image3.Visible = True
End Sub

Private Sub Image4_Click()
Image4.Visible = False
If a(4) = kotae Then
Image4.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image4.Visible = True
End Sub

Private Sub Image5_Click()
Image5.Visible = False
If a(5) = kotae Then
Image5.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image5.Visible = True
End Sub

Private Sub Image6_Click()
Image6.Visible = False
If a(6) = kotae Then
Image6.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image6.Visible = True
End Sub

Private Sub Image7_Click()
Image7.Visible = False
If a(7) = kotae Then
Image7.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image7.Visible = True
End Sub

Private Sub Image8_Click()
Image8.Visible = False
If a(8) = kotae Then
Image8.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image8.Visible = True
End Sub

Private Sub Image9_Click()
Image9.Visible = False
If a(9) = kotae Then
Image9.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image9.Visible = True
End Sub

Private Sub Image10_Click()
Image10.Visible = False
If a(10) = kotae Then
Image10.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image10.Visible = True
End Sub

Private Sub Image11_Click()
Image11.Visible = False
If a(11) = kotae Then
Image11.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image11.Visible = True
End Sub

Private Sub Image12_Click()
Image12.Visible = False
If a(12) = kotae Then
Image12.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image12.Visible = True
End Sub

Private Sub Image13_Click()
Image13.Visible = False
If a(13) = kotae Then
Image13.Picture = Image29.Picture
seikai
Else
missdesu
End If
Image13.Visible = True
End Sub


完成品

改良版

 
動画が旨くご覧いただけない場合は最新のFlash Playerをインストールしてください
web ブラウザがインターネットエクスプローラ6(IE6)以下の場合メニューが崩れてしまうことがあります。
インターネットエクスプローラ7、Sleipnir、Mozilla Firefoxをご使用ください。