PDA

View Full Version : Javascript Blackjack Help

whiteflip
22nd August 2002, 07:45
I am going to make a black jack game that offers dealers in Javascript

What i need is tips on how to make the black jack engine

You start out with 1000 dollars and choose the bet ammount. and earn money and stuff. Straight black jacks earn 1.5 X your bet. How should i implement the double down system? and splitting! Splitting seems to be the hardest part of the game.

ctn|chrisw
22nd August 2002, 08:22
What? me not understand...I better start reading that javascript for dummies book I got 2 years ago

whiteflip
22nd August 2002, 10:19
what i got so far
cash = 1000
blackjackGirls = new Array("girls/alpha.jpg",.....
faces = new Array("2","3","4","5","6","7","8","9",
"10","J","Q","K","A")
document.writeln('cash: ')
document.writeln(cash)
}

function deal(){
for (randCard=0; randCard < 13; randCard++){
card1 = Math.round(Math.random()*randCard)
card2 = Math.round(Math.random()*randCard)
}
card1face = faces[card1]
card1value = card1 + 2
if (card1value >= 11 && card1value <= 13){
card1value = 10
}
if (card1value == 14){
card1value == 11
}

card2face = faces[card2]
card2value = card2 + 2
if (card2value >= 11 && card2value <= 13){
card2value = 10
}
if (card2value == 14){
card2value == 11
}
document.writeln('<br><br>card1: ' + card1)
document.writeln('<br>card1face: ' + card1face)
document.writeln('<br>card1value: ' + card1value)
document.writeln('<br><br>card2: ' + card2)
document.writeln('<br>card2face: ' + card2face)
document.writeln('<br>card2value: ' + card2value)
}

deal()

not much at all. when im done ill post my simple blackjack game for everyone to use. it will have pictures of cards instead of numbers and it will have a dealer.

Curi0us_George
22nd August 2002, 14:03
Brainjar.com has a Javascript Card Object tutorial. It could be useful for your purposes. It's also got a fully working blackjack table, so you probably want to steer clear of that section, unless you are wanting to plagiarize someone else's code.

whiteflip
22nd August 2002, 14:55
so if i get stuck i cant look at his code for help i have to write my own? can i play his blackjack game? :)

whiteflip
22nd August 2002, 14:59
:eek:
his cards are made in DOM
he has an insurance pop up alert thinggy
its pretty
its got split. i have no idea how to implement split

hes really good.

computer science 101's extra credit project is to make blackjack. of course its C++ not javascript...

Curi0us_George
22nd August 2002, 15:43
Yup. He's quite "bad-assed", as one might say. :D

whiteflip
22nd August 2002, 18:33
the javascript game im making is my second javascript project.....
maybe i shoulda acumulated more experience.

although it will take a long time to make and debug its gonna have a feature that brainjar's doesnt.

stripping dealers :)

simple, the more money you make the less they have,,, on... kinda like strip poker. i couldnt find a decent strip blackjack game to play so im making one. anyone else wanna play it when im done?

whiteflip
22nd August 2002, 18:35
forgot...

squell
22nd August 2002, 18:45
woo hoo, i'll definately want to play it. naked people! woo! what's in the attachment?

whiteflip
22nd August 2002, 21:19
Originally posted by squell
woo hoo, i'll definately want to play it. naked people! woo! what's in the attachment?

my ass hurts form all the sitting and coding. and im using the comfortable chair!

new attachment. its the black jack game without the black jack or nakid ness. blackjack functionality will be implemented during the right now phase and nakedness will be during the last part phase.

people who are savvy take a look at the script file and html file and css file and tell me what would be better than what i came up with.

whiteflip
22nd August 2002, 21:21
they should let you attach files from edit:mad:

its a very limted black jack. you cant choose the number of decks or shuffle frequency. thats preminantly set too 9 decks and shuffles every time. you can only hit up to 5 cards. if you get 5 cards im thinking of implemening the 5 card win rule
splitting is gonna be damn hard to do. i need help there.

squell
22nd August 2002, 21:55
looking good so far. :up: