Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 second ever program - blackjack
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
noobprogrammer123




PostPosted: Sat May 01, 2004 4:56 pm   Post subject: second ever program - blackjack

this is the second program i have ever made


BlackJack.t
 Description:

Download
 Filename:  BlackJack.t
 Filesize:  28.04 KB
 Downloaded:  338 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat May 01, 2004 5:05 pm   Post subject: (No subject)

ouch, I cry Crying or Very sad

well you're just starting programming... so I suppose you just don't know any better Thinking

but don't worry - soon you'll be able to rewrite blackjack to look better and be under 100 lines of code Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Paul




PostPosted: Sat May 01, 2004 5:06 pm   Post subject: (No subject)

Nice program. If its that big, why not bugproof it? like not allowing people to enter an character when betting.
guruguru




PostPosted: Sun May 02, 2004 10:52 am   Post subject: (No subject)

Pretty good for second program. Try using less ifs, then it would be sweet.
beedub




PostPosted: Thu May 06, 2004 9:15 pm   Post subject: (No subject)

maybe using a record so, u can add suits and other values. good try i guess
the_short1




PostPosted: Thu May 06, 2004 10:04 pm   Post subject: (No subject)

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




PostPosted: Wed Oct 13, 2004 1:29 pm   Post subject: (No subject)

nice work for a 2nd program lol better than my 2nd
4 bits for effort
wtd




PostPosted: Wed Oct 13, 2004 6:32 pm   Post subject: (No subject)

You're working too hard. Smile

code:
    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:

code:
    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.

code:
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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: