助けてください
■ このスレッドは過去ログ倉庫に格納されています
0001あず
NGNG自分でとりあえずやってみたものも(下のです)、実行しても動きません。
ルールは変えてもいいと言われたので、役は2、3、4、5カードのみ、
ハートとかの種類も省きました。
ゲームの勝敗を得点で表しExcelのシートに書き出せとのことです。
動かない理由をどうか教えてください。
0002あず
NGNGDim com(4) As Integer, man(4) As Integer
Randomize
manhand man(4)
comhand com(4)
fight com(4), man(4)
End Sub
0003あず
NGNGx = getcard("computer")
For x = 0 To 4
comhand com(x)
Next x
MsgBox "com'scards are " & com(0) & "," & com(1) & "," & com(2) & "," & com(3) & "," & com(4)
End Sub
Sub manhand(x As Integer)
x = getcard("YOU")
For x = 0 To 4
manhand man(x)
Next x
MsgBox "man'scards are " & man(0) & "," & man(1) & "," & man(2) & "," & man(3) & "," & man(4)
End Sub
0004デフォルトの名無しさん
NGNG0005あず
NGNGIf man(0) = man(1) = man(2) = man(3) = man(4) Then
x = 5
ElseIf man(x) = man(x) = man(x) = man(x) Then
x = 4
ElseIf man(x) = man(x) = man(x) Then
x = 3
ElseIf man(x) = man(x) Then
x = 2
Else
x = 1
End If
0006あず
NGNGy = 5
ElseIf com(x) = com(x) = com(x) = com(x) Then
y = 4
ElseIf com(x) = com(x) = com(x) Then
y = 3
ElseIf com(x) = com(x) Then
y = 2
Else
y = 1
End If
0007デフォルトの名無しさん
NGNG0008あず
NGNGMsgBox "you are the winner"
Sheet1.Cells(1, 1).Value = 1
ElseIf x < y Then
MsgBox "computer is the winner"
Sheet1.Cells(1, 1).Value = 2
ElseIf x = y Then
MsgBox "draw game"
Sheet1.Cells(1, 1).Value = 3
End If
0009デフォルトの名無しさん
NGNGFunction getcard(namae As String) As Integer
getcard = Int(Rnd * 13) + 1
MsgBox namae & " draw " & getcard
End Function
0010あず
NGNG0011デフォルトの名無しさん
NGNG0012デフォルトの名無しさん
NGNG0013デフォルトの名無しさん
NGNG学校名、名前と学籍番号くらい書け。
0014デフォルトの名無しさん
NGNGカードゲーム用コンポーネント
Free Delphi components programs.
http://www.davidmayne.co.uk/delphi.htm
0015デフォルトの名無しさん
NGNG社会に出てきても邪魔なだけ
氏ぬまで家に引き籠もってママの脛でも囓りながら生きろ
0016デフォルトの名無しさん
NGNG/ ̄ ̄ ̄ ̄\
( 人_____,,)
|ミ/ ー◎-◎-) ボクハ ホントウハ ツヨインダゾ・・・ブツブツ
(6 (_ _) ) カタカタカタ
| ∴ ノ 3 .ノ ______
ヽ、,, __,ノ | | ̄ ̄\ \
/ \.____| | | ̄ ̄|
/ \___ | | |__|
| \ |つ |__|__/ /
/  ̄ ̄ | ̄ ̄ ̄ ̄| 〔 ̄ ̄〕
0017デフォルトの名無しさん
NGNG0018デフォルトの名無しさん
NGNG■ このスレッドは過去ログ倉庫に格納されています