Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Black jack problem
Author Message
rupert_lucy

Posted: Sun Nov 16, 2003 12:48 am   Post subject: Black jack problem

Hello. If you guys could help me, I would really really appreciate it..
Seriously, I do not know anything about this..and I'm totally lost during the class and so are others. but the teacher told us to make a Black jack program.. and I just have NO IDEA what to do...
Can somebody help me??
I don't even know what Black jack is!!!!!!!!!!!

Tony

Posted: Sun Nov 16, 2003 1:00 am   Post subject: (No subject)

wow... well if you dont understand a thing in class... maybe you shouldn't be taking it

BlackJack is a card game. The objective is to get as close to 21 as possible, without going over it. Each number card is worth the number on it. Each face card is 10. Ace is ether 1 or 11.
Tony's programming blog. DWITE - a programming contest.

Posted: Sun Dec 07, 2003 7:57 pm   Post subject: ..

Yeah...if you can't design something as simple as BlackJack...well, its just kind of sad. My teacher told me to design a text based blackjack, so I did, it was easy. Then I started a new one, made a little graphics, here is th e code for what I did on that. (I stopped coding that a long while ago, im pretty sure you could adapt it for your purposes.) This is not to give you the answer to your problem, but help you understand it, and help you understand how to find a solution.
 code: var card, npctotal, npccard, total, num, cash, bet, intin : int var input : string cash := 10 procedure reset     total := 0     card := 0     npctotal := 0     num := 0     bet := 0     Draw.Box (10, 10, 80, 120, 255)     Draw.Box (90, 10, 160, 120, 255)     Draw.Box (10, 260, 80, 370, 255)     Draw.Box (90, 260, 160, 370, 255)     locate (19, 22)     put "Cards Total: ", total, "" ..     locate (20, 22)     put "Cash: \$", cash     locate (21, 22)     put "Bet: \$", bet     locate (25, 22)     put "[hit , stand , raise bet , lower bet]" end reset reset loop     locate (23, 22)     put " "     locate (23, 22)     put "Command: " ..     get input : *     if input = "hit" then         randint (card, 1, 10)         total := total + card         num := num + 1     elsif input = "raise bet" then         locate (18, 40)         put ""         locate (18, 40)         put "By how much: " ..         get intin         if intin <= cash then             bet := bet + intin             cash := cash - intin             locate (18, 40)             put ""             locate (18, 40)             put "Bet raised up \$", intin         else             locate (18, 40)             put ""             locate (18, 40)             put "You do not have \$", intin, " to bet!"         end if     elsif input = "lower bet" then         locate (18, 40)         put ""         locate (18, 40)         put "By how much: " ..         get intin         if intin <= bet then             bet := bet - intin             cash := cash + intin             locate (18, 40)             put ""             locate (18, 40)             put "You take \$", intin, " out of your bet."         else             locate (18, 40)             put ""             locate (18, 40)             put "You cant lower your bet more than ", bet         end if     end if     locate (19, 3)     put "Card: ", card, "" ..     locate (19, 22)     put "Cards Total: ", total, "" ..     locate (20, 22)     put "Cash: \$", cash     locate (21, 22)     put "Bet: \$", bet     %666666     locate (17 + num, 13)     put "          " ..     locate (17 + num, 13)     put "Card: ", card, "" ..     %666666 end loop
Andy

Posted: Sun Dec 07, 2003 9:28 pm   Post subject: (No subject)

uhhh way to break our no cheating policy

Posted: Sun Dec 07, 2003 9:42 pm   Post subject: (No subject)

huh?! What is he using that to cheat at? Is that question in a contest or something??? Anyway, I just gave him the code to give him a ""general idea"" of how a graphical blackjack might work
koby93

Posted: Mon Dec 08, 2003 11:05 pm   Post subject: (No subject)

hey lucy are u from london ontairo and go to CCH high schol?
casue i think i know u
n e ways if u get this repy in private msg aight?
peace and ps do u have programming in 2nd peroid with Mr.Lyle?
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 6 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: