Thread: What do you think?

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    68

    What do you think?

    Ok sorry I didnt know where to post this so I thought this would be a good place.

    Ok ive been making a very simple Console Based BlackJack game, with the help of quite a few people (which I am very thankful for).

    I was wondering what people thought about it, improvements etc. Its in C source code is provided as well as a binary. There is one error which I know about however it works as expected.

    Also there is no menu or help but i think its pretty straight forward to use however when things go buzzing by on the console it maybe confusing, I was thinking about implementing a pause, but will be looking into ncurses to make it easier.

    Unfortunately this board doesnt allow zip files. http://webmobo.com/blackjack/blackjack.zip

    So far Ive only been developing on Linux so I dont have any idea if it works on Windows, and unfortunately not around a PC that has Windows which is working.

    So what do you think?

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    I can't download and play that at work, but I just want to mention
    Its in C source code is provided as well as a binary.
    This is how you provide programs, people!

    Good job

  3. #3
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Code + Exe = Rep++
    Visit entropysink.com - It's what your PC is made for!

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Quote Originally Posted by gsoft
    So far Ive only been developing on Linux so I dont have any idea if it works on Windows, and unfortunately not around a PC that has Windows which is working.
    Builds (-Wall) with 1 warning:
    Quote Originally Posted by gcc 3.4.2 (mingw-special)
    game.c:125: warning: implicit declaration of function 'nextCard'
    but when you run it, it dies horribly when you try to enter a name.
    Quote Originally Posted by gsoft
    So what do you think?
    It builds and runs, as stated, on linux - and I won, which can't be bad.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    I like code Rouss's Avatar
    Join Date
    Apr 2004
    Posts
    131

    Nice little game.

    Nice blackjack game.
    One question though, how do you quit, other than losing all of your money (or ctrl-c) that is?
    A pause would be very useful if someone wanted to watch what was going on. Maybe you could use time.h to work something out.
    Also, I think it might look better if the players where in a row, instead of a column. Such as
    Code:
    User          AI             AI              AI           Dealer
    Hand          Hand           Hand            Hand         Hand
    But that's just an opinion. It's a good game overall. Good work.

    Oh, are you planning on adding anything too it? Like being able to split, double down, or buy insurance?
    Last edited by Rouss; 01-13-2005 at 11:41 AM.

  6. #6
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Under Windows, it compiles without any trouble (at least, I don't think I changed anything). That name error can be fixed by moving the tmp->next = NULL statement above the if (*head == NULL) in addNode. I kept getting a lot of junk characters after the cards, which looks like a string didn't get terminated. I also get an infinite loop after I choose hit or stand. At least I got to enter my name. =/
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  7. #7
    Registered User
    Join Date
    Jul 2004
    Posts
    68
    Quote Originally Posted by Rouss
    Nice blackjack game.
    One question though, how do you quit, other than losing all of your money (or ctrl-c) that is?
    A pause would be very useful if someone wanted to watch what was going on. Maybe you could use time.h to work something out.
    Also, I think it might look better if the players where in a row, instead of a column. Such as
    Code:
    User          AI             AI              AI           Dealer
    Hand          Hand           Hand            Hand         Hand
    But that's just an opinion. It's a good game overall. Good work.

    Oh, are you planning on adding anything too it? Like being able to split, double down, or buy insurance?
    Yea I know its a bit annoying how it goes down fast. I actually have a small pause function which is from what I can tell portable so I might add that in. Also the quit one, to be all honest that totally slipped my mind. Im sure I can work something out to put them in Columns.

    game.c:125: warning: implicit declaration of function 'nextCard
    Yea thats the error I was talking about its in deck.c and is called in blackjack.c however in game.c for some reason it cant be seen to the function however it somehow manages to get a next card.

    Oh, are you planning on adding anything too it? Like being able to split, double down, or buy insurance?
    Yea, not too sure on insurance ive read up on it and dont understand much on how it works however split and double I understand and Ill add it in a little later. I guess its get fixing up

    Thanks everyone thus far for telling me what they think.

  8. #8
    I like code Rouss's Avatar
    Join Date
    Apr 2004
    Posts
    131
    I never use insurance... But I guess some people do if it exists.
    I can't remember exactly, but either when 1) the dealer has an Ace showing, you can buy insurance incase the face down card is a 10 value, or the reverse (10 showing, insurance in case of Ace). If you buy insurance, and the dealer has blackjack, you break even... If you buy insurance and the dealer doesn't have blackjack, then you lose some money.

  9. #9
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Insurance is a sucker bet

    Basically it only applies when the dealer has an Ace showing. The player can then put down a bet of half his original bet, and then if the dealer gets blackjack you win double the bet BUT you lose your original bet since the dealers blackjack beats your hand. So basically you break even. If however the dealer doesn't have a blackjack you lose your half bet and possibly one and a half bets total if you still lose the hand. Only do if you are a card counter and the odds are heavily in favor of the dealer getting a ten.

  10. #10
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    Get three errors during compile:


    Compiling...
    player.c
    blackjack.c
    game.c
    c:\documents and settings\owner\my documents\dowload\blackjack\blackjack\game.c(125) : warning C4013: 'nextCard' undefined; assuming extern returning int
    c:\documents and settings\owner\my documents\dowload\blackjack\blackjack\game.c(399) : error C2057: expected constant expression
    c:\documents and settings\owner\my documents\dowload\blackjack\blackjack\game.c(399) : error C2466: cannot allocate an array of constant size 0
    c:\documents and settings\owner\my documents\dowload\blackjack\blackjack\game.c(399) : error C2133: 'temp' : unknown size
    deck.c
    Error executing cl.exe.

    player.exe - 3 error(s), 1 warning(s)
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

Popular pages Recent additions subscribe to a feed