Search:

Type: Posts; User: wipeout4wh

Page 1 of 2 1 2

Search: Search took 0.03 seconds.

  1. Replies
    37
    Views
    11,248

    I had to use && instead of ||. do { ...

    I had to use && instead of ||.


    do {
    cin>> viewInstructions;
    cin.ignore();

    switch(toupper(viewInstructions)) {
    case 'Y':
    cout<<...
  2. Replies
    37
    Views
    11,248

    Why should I avoid static and global variables?...

    Why should I avoid static and global variables? Isn't it kind of necessary to use them sometimes?

    I did manage to fix my do/while loop before you posted that, but I didn't mention it.


    do {
    ...
  3. Replies
    37
    Views
    11,248

    Yeah... I didn't really understand that. ...

    Yeah... I didn't really understand that.



    So shuffleDeck() should use deck as a parameter? I made deck a global variable, so shuffleDeck() can access it even if it's not a parameter. Do I still...
  4. Replies
    37
    Views
    11,248

    I've learned a little about pointers, but I still...

    I've learned a little about pointers, but I still don't completely understand why they are useful. I'll change my shuffling function to loop 52 times instead of 500. The code I posted only loops 100...
  5. Replies
    37
    Views
    11,248

    The index is just the part of an array that's in...

    The index is just the part of an array that's in square brackets, right?

    If I do that, it would still reuse the cards that are still in play when I reshuffle the deck. If I have a 5 in my hand,...
  6. Replies
    37
    Views
    11,248

    How would it eliminate the need to repopulate the...

    How would it eliminate the need to repopulate the array? I would have to send the cards that are no longer in play to a discard pile array, then bring them back to the deck when it's reshuffled.
    ...
  7. Replies
    37
    Views
    11,248

    I guess, but drawing a random card is easier, and...

    I guess, but drawing a random card is easier, and it accomplishes the same task in the long run. Is there really any benefit besides making the game's programming more realistic?
  8. Replies
    37
    Views
    11,248

    I don't know anything about pointers yet, so I...

    I don't know anything about pointers yet, so I don't know what any of that means. I still don't see why shuffling is necessary, either.
  9. Replies
    37
    Views
    11,248

    But that still doesn't solve the problem of...

    But that still doesn't solve the problem of getting a new, partially full deck (not including the cards that are in play) when every card is gone. Drawing a random card is pretty much the equivalent...
  10. Replies
    37
    Views
    11,248

    So there's no way to reset the deck? How would I...

    So there's no way to reset the deck? How would I make it possible to continue playing after the deck runs out of cards, and prevent the infinite loop?
  11. Replies
    37
    Views
    11,248

    Sorry if this is off-topic, but is there a way to...

    Sorry if this is off-topic, but is there a way to efficiently check the sum of each value in an array without manually adding deck[1] + deck[2] + deck[3] etc., and a way to force a static variable to...
  12. Replies
    37
    Views
    11,248

    I didn't use that before because I didn't know...

    I didn't use that before because I didn't know what static was. I just looked it up and did it, and you're both right. It compiles without any warnings now, and it doesn't repeat any cards. Thanks...
  13. Replies
    37
    Views
    11,248

    This is the full code: #include ...

    This is the full code:


    #include <iostream>
    #include <cmath>
    #include <ctime>
    #include <cstdlib>

    using namespace std;
    int drawCard();
  14. Replies
    37
    Views
    11,248

    It compiles in Code::Blocks with one warning. ...

    It compiles in Code::Blocks with one warning.


    C:\Documents and Settings\David\My Documents\Programming\Blackjack\main.cpp|28|warning: extended initializer lists only available with -std=c++0x or...
  15. Replies
    37
    Views
    11,248

    Leaving both int and [52] out works, leaving...

    Leaving both int and [52] out works, leaving this:



    while (loop != 0) {
    deck =...
  16. Replies
    37
    Views
    11,248

    while (loop != 0) { deck[52] =...

    while (loop != 0) {
    deck[52] = {1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13};
    loop = 0;
    }

    Would...
  17. Replies
    37
    Views
    11,248

    Thanks. I have the do... while loop and the...

    Thanks. I have the do... while loop and the temporary variable done. The return is at the end, and it's at least choosing cards now. I put the time stuff and srand(now) in main(), but now it's...
  18. Replies
    37
    Views
    11,248

    The last line is supposed to remove the drawn...

    The last line is supposed to remove the drawn card from the deck (by setting its value to 0), so it should remember the current state AFAIK. Since the while loop that initiates the array sets loop to...
  19. Replies
    37
    Views
    11,248

    I need help with a Blackjack game.

    I'm writing a simple Blackjack game, but I'm having a problem. This is my code so far:


    #include <iostream>
    #include <cmath>
    #include <ctime>
    #include <cstdlib>

    using namespace std;
    int...
  20. Replies
    9
    Views
    1,756

    What do you mean by "the right type"?

    What do you mean by "the right type"?
  21. Replies
    9
    Views
    1,756

    On line 6 ("{") I get: number of arguments...

    On line 6 ("{") I get: number of arguments doesn't match prototype.
    On line 1040 (Which doesn't exist...) I get: prototype declaration.

    What arguments do I need to use?
  22. Replies
    9
    Views
    1,756

    I did that, now I get an error on "{".

    I did that, now I get an error on "{".
  23. Replies
    9
    Views
    1,756

    That doesn't help... The program only runs for...

    That doesn't help...

    The program only runs for a few seconds, so I really don't see a reason to click the minimize button. I want it to run minimized from the beginning so I never have to see it....
  24. Replies
    9
    Views
    1,756

    Running a program minimized

    Is there a way to make a program run minimized? I know you can just make a shortcut that runs minimize, but how can I do it without a shortcut?
  25. Replies
    12
    Views
    3,749

    Ok, I figured out how to make it restart without...

    Ok, I figured out how to make it restart without a loop. I'm done with the game now, but how can I assign an icon to the .exe?
Results 1 to 25 of 39
Page 1 of 2 1 2