Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
If 1s<4
1s=1s+1
end if
randomize
cardtype=int(RND*14)+1
Select Case cardtype
Case 1
card="1"
Case 2
card="2"
etc
Case 14
card="A"
End Select
Select Case card
case "1"
If 1s<4
1s=1s+1
end if
etc
End Select
Select Case card
case "1"
cardpoints=1
...
case "A"
cardpoints=10
If 1s<4
1s=1s+1
End If
Select Case card
case "1"
Action.LoadAPicture Hotspot(index), "imagefilename.extention"
etc
End Select
randomize
cardtype=int(RND*13)+1
Select Case cardtype
Case 1
card="A"
Case 2
card="2"
Case 3
card="3"
Case 4
card="4"
Case 5
card="5"
Case 6
card="6"
Case 7
card="7"
Case 8
card="8"
Case 9
card="9"
Case 10
card="10"
Case 11
card="J"
Case 12
card="Q"
Case 13
card="K"
End Select
Select Case card
case "A"
If cA<4
cA=cA+1
end if
case "2"
If c2<4
c2=c2+1
end if
case "3"
If c3<4
c3=c3+1
end if
case "4"
If c4<4
c4=c4+1
end if
case "5"
If c5<4
c5=c5+1
end if
case "6"
If c6<4
c6=c6+1
end if
case "7"
If c7<4
c7=c7+1
end if
case "4"
If c8<4
c8=c8+1
end if
case "9"
If c9<4
c9=c9+1
end if
case "10"
If cT<4
cT=cT+1
end if
case "J"
If cJ<4
cJ=cJ+1
end if
case "Q"
If cQ<4
cQ=cQ+1
end if
case "K"
If cK<4
cK=cK+1
end if
End Select
Select Case card
case "A"
cardpoints=11
case "2"
cardpoints=2
case "3"
cardpoints=3
case "4"
cardpoints=4
case "5"
cardpoints=5
case "6"
cardpoints=6
case "7"
cardpoints=7
case "8"
cardpoints=8
case "9"
cardpoints=9
case "10"
cardpoints=10
case "J"
cardpoints=10
case "Q"
cardpoints=10
case "K"
cardpoints=10
End Select
Select Case card
case "A"
Action.LoadAPicture Hotspot(1), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(1), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(1), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(1), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(1), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(1), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(1), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(1), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(1), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(1), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(1), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(1), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(1), "King.bmp"
End Select
If cA<4 Then
actions
End If
If points<dealerpoints or points=dealerpoints Then
'code for player lose
Else If points>dealerpoints and points<=21 Then
'code for player win
End If
If Hotspot(12).Picture = Nothing Then
randomize
cardtype3=int(RND*13)+1
Select Case cardtype3
Case 1
card3="A"
Case 2
card3="2"
Case 3
card3="3"
Case 4
card3="4"
Case 5
card3="5"
Case 6
card3="6"
Case 7
card3="7"
Case 8
card3="8"
Case 9
card3="9"
Case 10
card3="10"
Case 11
card3="J"
Case 12
card3="Q"
Case 13
card3="K"
End Select
Select Case card3
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card3
case "A"
cardpoints3=11
case "2"
cardpoints3=2
case "3"
cardpoints3=3
case "4"
cardpoints3=4
case "5"
cardpoints3=5
case "6"
cardpoints3=6
case "7"
cardpoints3=7
case "8"
cardpoints3=8
case "9"
cardpoints3=9
case "10"
cardpoints3=10
case "J"
cardpoints3=10
case "Q"
cardpoints3=10
case "K"
cardpoints3=10
End Select
Select Case card3
case "A"
Action.LoadAPicture Hotspot(12), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(12), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(12), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(12), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(12), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(12), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(12), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(12), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(12), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(12), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(12), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(12), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(12), "King.bmp"
End Select
ElseIf Hotspot(13).Picture = Nothing Then
randomize
cardtype4=int(RND*13)+1
Select Case cardtype4
Case 1
card4="A"
Case 2
card4="2"
Case 3
card4="3"
Case 4
card4="4"
Case 5
card4="5"
Case 6
card4="6"
Case 7
card4="7"
Case 8
card4="8"
Case 9
card4="9"
Case 10
card4="10"
Case 11
card4="J"
Case 12
card4="Q"
Case 13
card4="K"
End Select
Select Case card4
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card4
case "A"
cardpoints4=11
case "2"
cardpoints4=2
case "3"
cardpoints4=3
case "4"
cardpoints4=4
case "5"
cardpoints4=5
case "6"
cardpoints4=6
case "7"
cardpoints4=7
case "8"
cardpoints4=8
case "9"
cardpoints4=9
case "10"
cardpoints4=10
case "J"
cardpoints4=10
case "Q"
cardpoints4=10
case "K"
cardpoints4=10
End Select
Select Case card4
case "A"
Action.LoadAPicture Hotspot(13), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(13), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(13), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(13), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(13), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(13), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(13), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(13), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(13), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(13), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(13), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(13), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(13), "King.bmp"
End Select
ElseIf Hotspot(14).Picture = Nothing Then
randomize
cardtype5=int(RND*13)+1
Select Case cardtype5
Case 1
card5="A"
Case 2
card5="2"
Case 3
card5="3"
Case 4
card5="4"
Case 5
card5="5"
Case 6
card5="6"
Case 7
card5="7"
Case 8
card5="8"
Case 9
card5="9"
Case 10
card5="10"
Case 11
card5="J"
Case 12
card5="Q"
Case 13
card5="K"
End Select
Select Case card5
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card5
case "A"
cardpoints5=11
case "2"
cardpoints5=2
case "3"
cardpoints5=3
case "4"
cardpoints5=4
case "5"
cardpoints5=5
case "6"
cardpoints5=6
case "7"
cardpoints5=7
case "8"
cardpoints5=8
case "9"
cardpoints5=9
case "10"
cardpoints5=10
case "J"
cardpoints5=10
case "Q"
cardpoints5=10
case "K"
cardpoints5=10
End Select
Select Case card5
case "A"
Action.LoadAPicture Hotspot(14), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(14), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(14), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(14), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(14), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(14), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(14), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(14), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(14), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(14), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(14), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(14), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(14), "King.bmp"
End Select
ElseIf Hotspot(15).Picture = Nothing Then
randomize
cardtype6=int(RND*13)+1
Select Case cardtype6
Case 1
card6="A"
Case 2
card6="2"
Case 3
card6="3"
Case 4
card6="4"
Case 5
card6="5"
Case 6
card6="6"
Case 7
card6="7"
Case 8
card6="8"
Case 9
card6="9"
Case 10
card6="10"
Case 11
card6="J"
Case 12
card6="Q"
Case 13
card6="K"
End Select
Select Case card6
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card6
case "A"
cardpoints6=11
case "2"
cardpoints6=2
case "3"
cardpoints6=3
case "4"
cardpoints6=4
case "5"
cardpoints6=5
case "6"
cardpoints6=6
case "7"
cardpoints6=7
case "8"
cardpoints6=8
case "9"
cardpoints6=9
case "10"
cardpoints6=10
case "J"
cardpoints6=10
case "Q"
cardpoints6=10
case "K"
cardpoints6=10
End Select
Select Case card6
case "A"
Action.LoadAPicture Hotspot(15), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(15), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(15), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(15), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(15), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(15), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(15), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(15), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(15), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(15), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(15), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(15), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(15), "King.bmp"
End Select
ElseIf Hotspot(16).Picture = Nothing Then
randomize
cardtype7=int(RND*13)+1
Select Case cardtype7
Case 1
card7="A"
Case 2
card7="2"
Case 3
card7="3"
Case 4
card7="4"
Case 5
card7="5"
Case 6
card7="6"
Case 7
card7="7"
Case 8
card7="8"
Case 9
card7="9"
Case 10
card7="10"
Case 11
card7="J"
Case 12
card7="Q"
Case 13
card7="K"
End Select
Select Case card7
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card7
case "A"
cardpoints7=11
case "2"
cardpoints7=2
case "3"
cardpoints7=3
case "4"
cardpoints7=4
case "5"
cardpoints7=5
case "6"
cardpoints7=6
case "7"
cardpoints7=7
case "8"
cardpoints7=8
case "9"
cardpoints7=9
case "10"
cardpoints7=10
case "J"
cardpoints7=10
case "Q"
cardpoints7=10
case "K"
cardpoints7=10
End Select
Select Case card7
case "A"
Action.LoadAPicture Hotspot(16), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(16), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(16), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(16), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(16), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(16), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(16), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(16), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(16), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(16), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(16), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(16), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(16), "King.bmp"
End Select
ElseIf Hotspot(17).Picture = Nothing Then
randomize
cardtype8=int(RND*13)+1
Select Case cardtype8
Case 1
card8="A"
Case 2
card8="2"
Case 3
card8="3"
Case 4
card8="4"
Case 5
card8="5"
Case 6
card8="6"
Case 7
card8="7"
Case 8
card8="8"
Case 9
card8="9"
Case 10
card8="10"
Case 11
card8="J"
Case 12
card8="Q"
Case 13
card8="K"
End Select
Select Case card8
case "A"
If cA<4 Then
cA=cA+1
end if
case "2"
If c2<4 Then
c2=c2+1
end if
case "3"
If c3<4 Then
c3=c3+1
end if
case "4"
If c4<4 Then
c4=c4+1
end if
case "5"
If c5<4 Then
c5=c5+1
end if
case "6"
If c6<4 Then
c6=c6+1
end if
case "7"
If c7<4 Then
c7=c7+1
end if
case "4"
If c8<4 Then
c8=c8+1
end if
case "9"
If c9<4 Then
c9=c9+1
end if
case "10"
If cT<4 Then
cT=cT+1
end if
case "J"
If cJ<4 Then
cJ=cJ+1
end if
case "Q"
If cQ<4 Then
cQ=cQ+1
end if
case "K"
If cK<4 Then
cK=cK+1
end if
End Select
Select Case card8
case "A"
cardpoints8=11
case "2"
cardpoints8=2
case "3"
cardpoints8=3
case "4"
cardpoints8=4
case "5"
cardpoints8=5
case "6"
cardpoints8=6
case "7"
cardpoints8=7
case "8"
cardpoints8=8
case "9"
cardpoints8=9
case "10"
cardpoints8=10
case "J"
cardpoints8=10
case "Q"
cardpoints8=10
case "K"
cardpoints8=10
End Select
Select Case card8
case "A"
Action.LoadAPicture Hotspot(17), "Ace.bmp"
case "2"
Action.LoadAPicture Hotspot(17), "2.bmp"
case "3"
Action.LoadAPicture Hotspot(17), "3.bmp"
case "4"
Action.LoadAPicture Hotspot(17), "4.bmp"
case "5"
Action.LoadAPicture Hotspot(17), "5.bmp"
case "6"
Action.LoadAPicture Hotspot(17), "6.bmp"
case "7"
Action.LoadAPicture Hotspot(17), "7.bmp"
case "8"
Action.LoadAPicture Hotspot(17), "8.bmp"
case "9"
Action.LoadAPicture Hotspot(17), "9.bmp"
case "10"
Action.LoadAPicture Hotspot(17), "10.bmp"
case "J"
Action.LoadAPicture Hotspot(17), "Jack.bmp"
case "Q"
Action.LoadAPicture Hotspot(17), "Queen.bmp"
case "K"
Action.LoadAPicture Hotspot(17), "King.bmp"
End Select
End If
Select Case card
case "A"
If cA<4 Then
cA=cA+1
end if
cardpoints3=11
case "2"
...
End Select
If playerpoints>21 Then
If AceVAR>0 Then
AceVAR = AceVAR - 1
playerpoints = playerpoints - 10
Else
...
End If
End If
If cA<4 Then
cA = cA + 1
End If
If condition Then
Actions
Else If condition Then
Actions
End if
End if
Lyberodoggy wrote:While reading about programming in C#, I learned that there you can easily simulate deck suffling and sharing by creating an array with two indicators example: array(0)(0) are the coordinates of the ace of spades, array(0)(1) are for deuce of spades etc... I don't know if there 's such a method in VBS though, but you could use external programs like OCX files to do what you want in AM using C# programming. GM please check this and help us
Dim MyArray(WIDTH, HEIGHT)
MyArray(X,Y) = Z
Dim MyArray(8, 8)
MyArray(4,3) = "Hello"
deck(3,12)
dim deck(3,12)
dim shape
dim figure
dim i
shape=0
figure=0
for i=1 to 52
do while deck(shape,figure)=""
randomize
shape=int(RND*3)
randomize
figure=int(RND*12)
deck(shape,figure)=i
loop
next
for shape=0 to 3
for figure=0 to 12
msgbox deck(shape,figure)
next
next
dim deck(3,12)
dim shape
dim figure
dim i
shape=0
figure=0
for i=1 to 52
if deck(shape,figure)="" then
randomize
shape=int(RND*3)
randomize
figure=int(RND*12)
deck(shape,figure)=i
else
i=i-1
end if
next
for shape=0 to 3
for figure=0 to 12
msgbox deck(shape,figure)
next
next
Return to Adventure Maker Technical Support and Bug Reports
Users browsing this forum: No registered users and 0 guests