Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: OT Casino Games Estimate? hopefully helpful, ASP script pasted into body
From: Tony Gunn
Date: Thu, 8 Jun 2000 11:56:43 +0100

>I am mainly concerned with the time involved to create 20 casino games in
>flash. Would anyone venture a guess
>for the total time to do this?



I built an asp/database (score tracking) blackjack game w/ a Flash front
end.

took about 35 hours real time, not counting 10 hours on the deck & face
cards that I used for both games.


also built a 5 card draw poker game which took quite a bit more time, b/c of
the dealer card selection logic script, & the analyze hand & find winner
script.

took 60 hours real time..


I think out of the list of games you posted the following would be the most
time. Of course you could always keep it easy and do a 1 player 'video
poker' kinda thing, but this list assumes you've got a house player & have
to code the 2nd player 'house' logic.

>hearts
>spades
>cribbage
>chess
>checkers
>poker
>euchre
>pinochle
>gin
>bridge
>canasta

I'd say 60 - 100 hours for these games (each) on average.


& the others would be rather simple if you have basic programming skills.

>black jack
>craps
>roulette
>slots
>bingo
>anagram - don't know what this is?
>crossword
>word search
>crytogram - or this, but if it's a word game it belongs in the 'easy'
category.

& 30 - 60 hrs each, on these

-----------------
here's the ASP script I wrote that selects the dealer & player hand for the
blackjack game. this could easily have been done in ActionScript as well
but would require quite a few more lines.. come on MM, when's the Case
statement gonna be included in ActionScript?


Have a good one
TGunn
-----------------

<%@ Language=VBScript %>
<%
'grabs 1 card

function getCard()
randomize
lcount = (125 * rnd) * 1
for x = 0 to Cint(lcount)
val = (52 * rnd) * 1
if val > 51 then
val = 52.0
end if
if val < 1 then
val = 1.0
end if
next
getCard = CInt(val)
end function

'assigns file name to the card num
'cases are out of order to promote further randomness
'so 1-4 is not necessarily only for 2's & so on
'also assumes you have the deck of 52 swf's in the same folder as the main
movie.

function assignValue(num)
select case num
case 1 assignValue = "2d.swf"
case 11 assignValue = "2h.swf"
case 21 assignValue = "2c.swf"
case 31 assignValue = "2s.swf"

case 41 assignValue = "3d.swf"
case 51 assignValue = "3h.swf"
case 2 assignValue = "3c.swf"
case 12 assignValue = "3s.swf"

case 22 assignValue = "4d.swf"
case 32 assignValue = "4h.swf"
case 42 assignValue = "4c.swf"
case 52 assignValue = "4s.swf"

case 13 assignValue = "5d.swf"
case 23 assignValue = "5h.swf"
case 33 assignValue = "5c.swf"
case 43 assignValue = "5s.swf"

case 4 assignValue = "6d.swf"
case 14 assignValue = "6h.swf"
case 24 assignValue = "6c.swf"
case 34 assignValue = "6s.swf"

case 44 assignValue = "7d.swf"
case 5 assignValue = "7h.swf"
case 15 assignValue = "7c.swf"
case 25 assignValue = "7s.swf"

case 35 assignValue = "8d.swf"
case 45 assignValue = "8h.swf"
case 6 assignValue = "8c.swf"
case 16 assignValue = "8s.swf"

case 26 assignValue = "9d.swf"
case 36 assignValue = "9h.swf"
case 46 assignValue = "9c.swf"
case 7 assignValue = "9s.swf"

case 17 assignValue = "10d.swf"
case 27 assignValue = "10h.swf"
case 37 assignValue = "10c.swf"
case 47 assignValue = "10s.swf"

case 8 assignValue = "jd.swf"
case 18 assignValue = "jh.swf"
case 28 assignValue = "jc.swf"
case 38 assignValue = "js.swf"

case 48 assignValue = "qd.swf"
case 9 assignValue = "qh.swf"
case 19 assignValue = "qc.swf"
case 29 assignValue = "qs.swf"

case 39 assignValue = "kd.swf"
case 49 assignValue = "kh.swf"
case 10 assignValue = "kc.swf"
case 20 assignValue = "ks.swf"

case 30 assignValue = "ad.swf"
case 40 assignValue = "ah.swf"
case 50 assignValue = "ac.swf"
case 3 assignValue = "as.swf"

'defalut to 2s
case else assignValue = "2s.swf"
end select
end function

dc2flag = false
dc3flag = false
dc4flag = false
dc5flag = false
pc1flag = false
pc2flag = false
pc3flag = false
pc4flag = false
pc5flag = false
pc6flag = false
pc7flag = false
pc8flag = false
pc9flag = false
dc6flag = false
dc7flag = false
dc8flag = false
dc9flag = false
dc10flag = false
pc10flag = false


'get unique card, 1 deck so no repeats
dc1 = getCard()
do until dc2flag = true
dc2 = getCard()
if dc2 <> dc1 then
dc2flag = true
end if
loop

do until dc3flag = true
dc3 = getCard()
if dc3 <> dc1 and dc3 <> dc2 then
dc3flag = true
end if
loop

do until dc4flag = true
dc4 = getCard()
if dc4 <> dc1 and dc4 <> dc2 and dc4 <> dc3 then
dc4flag = true
end if
loop

do until dc5flag = true
dc5 = getCard()
if dc5 <> dc1 and dc5 <> dc2 and dc5 <> dc3 and dc5<> dc4 then
dc5flag = true
end if
loop

do until pc1flag = true
pc1 = getCard()
if pc1 <> dc1 and pc1 <> dc2 and pc1 <> dc3 and pc1 <> dc4 and pc1 <> dc5
then
pc1flag = true
end if
loop

do until pc2flag = true
pc2 = getCard()
if pc2 <> dc1 and pc2 <> dc2 and pc2 <> dc3 and pc2 <> dc4 and pc2 <> dc5
and pc2 <> pc1 then
pc2flag = true
end if
loop

do until pc3flag = true
pc3 = getCard()
if pc3 <> dc1 and pc3 <> dc2 and pc3 <> dc3 and pc3 <> dc4 and pc3 <> dc5
and pc3 <> pc1 and pc3 <> pc2 then
pc3flag = true
end if
loop

do until pc4flag = true
pc4 = getCard()
if pc4 <> dc1 and pc4 <> dc2 and pc4 <> dc3 and pc4 <> dc4 and pc4 <> dc5
and pc4 <> pc1 and pc4 <> pc2 and pc4 <> pc3 then
pc4flag = true
end if
loop


do until pc5flag = true
pc5 = getCard()
if pc5 <> dc1 and pc5 <> dc2 and pc5 <> dc3 and pc5 <> dc4 and pc5 <> dc5
and pc5 <> pc1 and pc5 <> pc2 and pc5 <> pc3 and pc5 <> pc4 then
pc5flag = true
end if
loop

do until pc6flag = true
pc6 = getCard()
if pc6 <> dc1 and pc6 <> dc2 and pc6 <> dc3 and pc6 <> dc4 and pc6 <> dc5
and pc6 <> pc1 and pc6 <> pc2 and pc6 <> pc3 and pc6 <> pc4 and pc6 <> pc5
then
pc6flag = true
end if
loop

do until pc7flag = true
pc7 = getCard()
if pc7 <> dc1 and pc7 <> dc2 and pc7 <> dc3 and pc7 <> dc4 and pc7 <> dc5
and pc7 <> pc1 and pc7 <> pc2 and pc7 <> pc3 and pc7 <> pc4 and pc7 <> pc5
and pc7 <> pc6 then
pc7flag = true
end if
loop

do until pc8flag = true
pc8 = getCard()
if pc8 <> dc1 and pc8 <> dc2 and pc8 <> dc3 and pc8 <> dc4 and pc8 <> dc5
and pc8 <> pc1 and pc8 <> pc2 and pc8 <> pc3 and pc8 <> pc4 and pc8 <> pc5
and pc8 <> pc6 and pc8 <> pc7 then
pc8flag = true
end if
loop

do until pc9flag = true
pc9 = getCard()
if pc9 <> dc1 and pc9 <> dc2 and pc9 <> dc3 and pc9 <> dc4 and pc9 <> dc5
and pc9 <> pc1 and pc9 <> pc2 and pc9 <> pc3 and pc9 <> pc4 and pc9 <> pc5
and pc9 <> pc6 and pc9 <> pc7 and pc9 <> pc8 then
pc9flag = true
end if
loop

do until dc6flag = true
dc6 = getCard()
if dc6 <> dc1 and dc6 <> dc2 and dc6 <> dc3 and dc6 <> dc4 and dc6 <> dc5
and dc6 <> pc1 and dc6 <> pc2 and dc6 <> pc3 and dc6 <> pc4 and dc6 <> pc5
and dc6 <> pc6 and dc6 <> pc7 and dc6 <> pc8 and dc6 <> pc9 then
dc6flag = true
end if
loop

do until dc7flag = true
dc7 = getCard()
if dc7 <> dc1 and dc7 <> dc2 and dc7 <> dc3 and dc7 <> dc4 and dc7 <> dc5
and dc7 <> pc1 and dc7 <> pc2 and dc7 <> pc3 and dc7 <> pc4 and dc7 <> pc5
and dc7 <> pc6 and dc7 <> pc7 and dc7 <> pc8 and dc7 <> pc9 and dc7 <> dc6
then
dc7flag = true
end if
loop


do until dc8flag = true
dc8 = getCard()
if dc8 <> dc1 and dc8 <> dc2 and dc8 <> dc3 and dc8 <> dc4 and dc8 <> dc5
and dc8 <> pc1 and dc8 <> pc2 and dc8 <> pc3 and dc8 <> pc4 and dc8 <> pc5
and dc8 <> pc6 and dc8 <> pc7 and dc8 <> pc8 and dc8 <> pc9 and dc8 <> dc6
and dc8 <> dc7 then
dc8flag = true
end if
loop

do until dc9flag = true
dc9 = getCard()
if dc9 <> dc1 and dc9 <> dc2 and dc9 <> dc3 and dc9 <> dc4 and dc9 <> dc5
and dc9 <> pc1 and dc9 <> pc2 and dc9 <> pc3 and dc9 <> pc4 and dc9 <> pc5
and dc9 <> pc6 and dc9 <> pc7 and dc9 <> pc8 and dc9 <> pc9 and dc9 <> dc6
and dc9 <> dc7 and dc9 <> dc8 then
dc9flag = true
end if
loop

do until dc10flag = true
dc10 = getCard()
if dc10 <> dc1 and dc10 <> dc2 and dc10 <> dc3 and dc10 <> dc4 and dc10 <>
dc5 and dc10 <> pc1 and dc10 <> pc2 and dc10 <> pc3 and dc10 <> pc4 and dc10
<> pc5 and dc10 <> pc6 and dc10 <> pc7 and dc10 <> pc8 and dc10 <> pc9 and
dc10 <> dc6 and dc10 <> dc7 and dc10 <> dc8 and dc10 <> dc9 then
dc10flag = true
end if
loop

do until pc10flag = true
pc10 = getCard()
if pc10 <> dc1 and pc10 <> dc2 and pc10 <> dc3 and pc10 <> dc4 and pc10 <>
dc5 and pc10 <> pc1 and pc10 <> pc2 and pc10 <> pc3 and pc10 <> pc4 and pc10
<> pc5 and pc10 <> pc6 and pc10 <> pc7 and pc10 <> pc8 and pc10 <> pc9 and
pc10 <> dc6 and pc10 <> dc7 and pc10 <> dc8 and pc10 <> dc9 and pc10 <>
dc10 then
pc10flag = true
end if
loop
%>




<%
' call to attach file name to variable

card1 = assignValue(dc1)
card2 = assignValue(dc2)
card3 = assignValue(dc3)
card4 = assignValue(dc4)
card5 = assignValue(dc5)
dcard1 = assignValue(pc1)
dcard2 = assignValue(pc2)
dcard3 = assignValue(pc3)
dcard4 = assignValue(pc4)
dcard5 = assignValue(pc5)
card6 = assignValue(pc6)
card7 = assignValue(pc7)
card8 = assignValue(pc8)
card9 = assignValue(pc9)
card10 = assignValue(pc10)
dcard6 = assignValue(dc6)
dcard7 = assignValue(dc7)
dcard8 = assignValue(dc8)
dcard9 = assignValue(dc9)
dcard10 = assignValue(dc10)
%>

<%'display results'%>
<%'Response.Write("<html><body>")%>
<%'=card1%><%'Response.Write("<br>")%>
<%'=card2%><%'Response.Write("<br>")%>
<%'=card3%><%'Response.Write("<br>")%>
<%'=card4%><%'Response.Write("<br>")%>
<%'=card5%><%'Response.Write("<br>")%>
<%'=card6%><%'Response.Write("<br>")%>
<%'=card7%><%'Response.Write("<br>")%>
<%'=card8%><%'Response.Write("<br>")%>
<%'=card9%><%'Response.Write("<br>")%>
<%'=dcard1%><%'Response.Write("<br>")%>
<%'=dcard2%><%'Response.Write("<br>")%>
<%'=dcard3%><%'Response.Write("<br>")%>
<%'=dcard4%><%'Response.Write("<br>")%>
<%'=dcard5%><%'Response.Write("<br>")%>
<%'=dcard6%><%'Response.Write("<br>")%>
<%'=dcard7%><%'Response.Write("<br>")%>
<%'=dcard8%><%'Response.Write("<br>")%>
<%'=dcard9%><%'Response.Write("<br>")%>
<%'=dcard10%><%'Response.Write("<br>")%>
<%'=card10%><%'Response.Write("<br>")%>
<%'Response.Write("</body></html>")%>

<!-- pack & send-->
<%="card1="+server.URLEncode(card1)%>
<%="&card2="+server.URLEncode(card2)%>
<%="&card3="+server.URLEncode(card3)%>
<%="&card4="+server.URLEncode(card4)%>
<%="&card5="+server.URLEncode(card5)%>

<%="&card6="+server.URLEncode(dcard1)%>
<%="&card7="+server.URLEncode(dcard2)%>
<%="&card8="+server.URLEncode(dcard3)%>
<%="&card9="+server.URLEncode(dcard4)%>
<%="&card10="+server.URLEncode(dcard5)%>

<%="&credits="+server.URLEncode(Session("credits"))%>
<%="&player="+server.URLEncode(Session("nickname"))%>
<%="&new="+server.URLEncode(session("new"))%>

<%Response.End%>







flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 15 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]