
-----------------------------------
DVL_IAC
Sat Mar 26, 2005 8:45 pm

Turing Black Jack help
-----------------------------------
I'm making a small black jack program in turing and i have it all done except i dont know how i would go about making it say the winner is whos ever closer to 21 without going over 21... like i wanna do 
if comp closer to 21 but not over 21 then
put "The computer wins" 
elsif user closer to 21 but not over 21 then
put "You win" 

idk what the code would be for "if comp closer to 21 but not over 21" and "if user closer to 21 but not over 21" :P

-----------------------------------
Armageddon
Sat Mar 26, 2005 9:47 pm


-----------------------------------
I'm no expert but maybe you should try something like this

If User < Comp  21 then 
put "user lost"
else 
if user > comp then
put "user win"
elsif user < comp then 
put "user lost"
else put "tied"
end if
end if
lala wish u do a good job, I think u can simplify the code btw :D

-----------------------------------
DVL_IAC
Sat Mar 26, 2005 11:02 pm


-----------------------------------
yep thats the right idea
but be careful
u have to do something like 
if comp > 21 then 
put "comp lost"
return
end if
if user > 21 then 
put "user lost"
else 
if user > comp then
put "user win"
elsif user < comp then 
put "user lost"
else put "tied"
end if
end if
lala wish u do a good job, I think u can simplify the code btw :D

hmm if the user gets 25 then the comp gets 22 using that code then it says "user looses" because it was higher then 21 then it says "user wins" because the user had a higher number then the comp... :?

-----------------------------------
DVL_IAC
Sat Mar 26, 2005 11:12 pm


-----------------------------------
I'm no expert but maybe you should try something like this

If User < Comp  21 then 
put "user lost"
else 
if user > comp then
put "user win"
elsif user < comp then 
put "user lost"
else put "tied"
end if
end if
lala wish u do a good job, I think u can simplify the code btw :D

hmm if the user gets 25 then the comp gets 22 using that code then it says "user looses" because it was higher then 21 then it says "user wins" because the user had a higher number then the comp... :?
no it wont because of it first check the comp if it got a higher number, and there is a else statement int eh user's code only when both the user and the computer are smaller or equal to 21 will the program compare each other/  

EDIT: to make the program work perfectly delete the return

-----------------------------------
person
Sun Mar 27, 2005 11:04 am


-----------------------------------
ssr: the dealer and the player cant both loose

DVL_IAC: it is the rules to make the dealer stop at 16 (just thought to explain to u wat Cervantes meant)

-----------------------------------
DVL_IAC
Sun Mar 27, 2005 5:02 pm


-----------------------------------
yay I'm pretty shure i got the program working perfactly :D it plays different sounds when different things happen now im just wondering if i should have a midi playing in the background or just keep it as it is with just sounds and no mus...

-----------------------------------
ssr
Sun Mar 27, 2005 6:42 pm


-----------------------------------
ssr: the dealer and the player cant both loose

DVL_IAC: it is the rules to make the dealer stop at 16 (just thought to explain to u wat Cervantes meant)

GJ DVL_IAC 
anyway 
why cant they both lose because the dealer has to stop at 16?
then they cant get 22 and a 25 right, 'caue both of them would be over 21 adn they both loses
anyway then put return in teh code.
but since u r finished 
gj

-----------------------------------
person
Sun Mar 27, 2005 7:14 pm


-----------------------------------
ssr: in the event that the dealer and the player both busts...the player wins

-----------------------------------
DVL_IAC
Sun Mar 27, 2005 9:53 pm


-----------------------------------
http://www.compsci.ca/v2/viewtopic.php?p=79117#79117 :D

-----------------------------------
ssr
Sun Mar 27, 2005 11:07 pm


-----------------------------------
ssr: in the event that the dealer and the player both busts...the player wins
u r a blackjack expert arnt u ^^

-----------------------------------
Mr. T
Sun Mar 27, 2005 11:29 pm


-----------------------------------
ssr: in the event that the dealer and the player both busts...the player wins
u r a blackjack expert arnt u ^^
actually, no. the player goes through his hand first. so if the player busts, then the game is over and the dealer doesnt even have to go.

-----------------------------------
Naveg
Sun Mar 27, 2005 11:30 pm


-----------------------------------
but if they tie the dealer wins right?

-----------------------------------
Mr. T
Sun Mar 27, 2005 11:32 pm


-----------------------------------
yes.

-----------------------------------
person
Mon Mar 28, 2005 11:40 am


-----------------------------------
There r 2 variations:

http://www.gameroom2000.com/free-casino-games/blackjack-rules.htm

http://www.casinoscompared.co.uk/blackjack_rules.asp

-----------------------------------
Naveg
Mon Mar 28, 2005 5:45 pm


-----------------------------------
interesting, thanks for the info

-----------------------------------
person
Tue Mar 29, 2005 3:55 pm


-----------------------------------
http://www.compsci.ca/v2/viewtopic.php?p=79335#79335

(i kno its messy and not complete but....)

-----------------------------------
Naveg
Wed Mar 30, 2005 12:15 am


-----------------------------------
it also doesnt work....

-----------------------------------
person
Wed Mar 30, 2005 3:00 pm


-----------------------------------
it also doesnt work.... 

LOL!! i forgot the pics

-----------------------------------
DVL_IAC
Fri Apr 08, 2005 6:18 pm


-----------------------------------
I made an updated version of my Black Jack. You can get it [url=http://www.compsci.ca/v2/viewtopic.php?p=80633#80633] >Here