
-----------------------------------
noobprogrammer123
Sat May 01, 2004 4:56 pm

second ever program - blackjack
-----------------------------------
this is the second program i have ever made

-----------------------------------
Tony
Sat May 01, 2004 5:05 pm


-----------------------------------
ouch, I cry :cry:

well you're just starting programming... so I suppose you just don't know any better :think:

but don't worry - soon you'll be able to rewrite blackjack to look better and be under 100 lines of code :wink:

-----------------------------------
Paul
Sat May 01, 2004 5:06 pm


-----------------------------------
Nice program. If its that big, why not bugproof it? like not allowing people to enter an character when betting.

-----------------------------------
guruguru
Sun May 02, 2004 10:52 am


-----------------------------------
Pretty good for second program. Try using less ifs, then it would be sweet.

-----------------------------------
beedub
Thu May 06, 2004 9:15 pm


-----------------------------------
maybe using a record so, u can add suits and other values. good try i guess

-----------------------------------
the_short1
Thu May 06, 2004 10:04 pm


-----------------------------------
yea... good for second program.... i woulkdn;t think a noob ** beginer programer... would attemp something like that... VDG...!!


btw...
beedub... both ur avatar and sig aint working..
PM me if u want me to host ur pictures at my server ***never fails..

-----------------------------------
zomg
Wed Oct 13, 2004 1:29 pm


-----------------------------------
nice work for a 2nd program lol better than my 2nd
4 bits for effort

-----------------------------------
wtd
Wed Oct 13, 2004 6:32 pm


-----------------------------------
You're working too hard.  :)

    if userCardNum1 = 1 then
	userCard1 := "A"
    elsif userCardNum1 = 2 then
	userCard1 := "2"
	userCount1 := 2
    elsif userCardNum1 = 3 then
	userCard1 := "3"
	userCount1 := 3
    elsif userCardNum1 = 4 then
	userCard1 := "4"
	userCount1 := 4
    elsif userCardNum1 = 5 then
	userCard1 := "5"
	userCount1 := 5
    elsif userCardNum1 = 6 then
	userCard1 := "6"
	userCount1 := 6
    elsif userCardNum1 = 7 then
	userCard1 := "7"
	userCount1 := 7
    elsif userCardNum1 = 8 then
	userCard1 := "8"
	userCount1 := 8
    elsif userCardNum1 = 9 then
	userCard1 := "9"
	userCount1 := 9
    elsif userCardNum1 = 10 then
	userCard1 := "10"
	userCount1 := 10
    elsif userCardNum1 = 11 then
	userCard1 := "J"
	userCount1 := 10
    elsif userCardNum1 = 12 then
	userCard1 := "Q"
	userCount1 := 10
    elsif userCardNum1 = 13 then
	userCard1 := "K"
	userCount1 := 10
    end if

Can easily become:

    if userCardNum1 = 1 then 
    	userCard1  := "A"
    elsif userCardNum1 = 11 then
    	userCard1  := "J"
    	userCount1 := 10
    elsif userCardNum1 = 12 then
    	userCard1  := "G"
    	userCount1 := 10
    elsif userCardNum1 = 13 then
    	userCard1  := "K"
    	userCount1 := 10
    else
    	userCard1  := intstr(userCardNum1)
    	userCount1 := userCardNum1
    end if

Which would be even easier as a case construct, though I'm not entirely sure of the syntax for it in Turing.

case userCardNum1 of
   label 1:
      userCard1  := "A"
   label 11:
      userCard1  := "J"
      userCount1 := 10
   label 12:
      userCard1  := "G"
      userCount1 := 10
   label 13:
      userCard1  := "K"
      userCount1 := 10
   else
      userCard1  := intstr(userCardNum1)
      userCount1 := userCardNum1
end case
