Results 1 to 8 of 8
  1. #1
    skittlznick2's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Location
    YOUR MOM KNOWS
    Posts
    87
    Reputation
    10
    Thanks
    8

    Could help beginer C++ users

    When i just started learning C++ i made a crappy Blackjack game.
    This could help on what some functions do.

    Ignore the pictures they got messed up when i pasted the code down...

    But i made it where if you lose in any way the skull comes up.If you draw the alien flips you off.And if you win it flashes multiple colors and a girl comes up.

    Heres the code:
    Code:
    #include <iostream>
    #include <cstdlib>
    #include <ctime>
    #include <windows.h>
    
    using namespace std;
    
    int getCard () {
    	return (rand () % 10)+2;
    }
    
    void skull () {
    
    	cout << "                               ...----....                          " << endl;
        cout << "                           ..-:"''         ''"-..                   " << endl;
        cout << "                       .-'                      '-.                 " << endl;
        cout << "                    .'              .     .       '.                " << endl;
        cout << "                  .'   .          .    .      .    .''.             " << endl;
        cout << "                 .'  .    .       .   .   .     .   . ..:.          " << endl;
        cout << "              .' .   . .  .       .   .   ..  .   . ....::.         " << endl;
        cout << "             ..   .   .      .  .    .     .  ..  . ....:IA.        " << endl;
        cout << "            .:  .   .    .    .  .  .    .. .  .. .. ....:IA.       " << endl;
        cout << "           .: .   .   ..   .    .     . . .. . ... ....:.:VHA.      " << endl;
        cout << "           '..  .  .. .   .       .  . .. . .. . .....:.::IHHB.     " << endl;
        cout << "          .:. .  . .  . .   .  .  . . . ...:.:... .......:HIHMM.    " << endl;
        cout << "         .:.... .   . ."::"'.. .   .  . .:.:.:II;,. .. ..:IHIMMA    " << endl;
        cout << "         ':.:..  ..::IHHHHHI::. . .  ...:.::::.,,,. . ....VIMMHM    " << endl;
        cout << "        .:::I. .AHHHHHHHHHHAI::. .:...,:IIHHHHHHMMMHHL:. . VMMMM    " << endl;
        cout << "      .:.:V.:IVHHHHHHHMHMHHH::..:" .:HIHHHHHHHHHHHHHMHHA. .VMMM.   " << endl;
        cout << "      :..V.:IVHHHHHMMHHHHHHHB... . .:VPHHMHHHMMHHHHHHHHHAI.:VMMI    " << endl;
        cout << "      ::V..:VIHHHHHHMMMHHHHHH. .   .I":IIMHHMMHHHHHHHHHHHAPI:WMM   " << endl;
        cout << "     ::". .:.HHHHHHHHMMHHHHHI.  . .:..I:MHMMHHHHHHHHHMHV:':H:WM    " << endl;
        cout << "      :: . :.::IIHHHHHHMMHHHHV  .ABA.:.:IMHMHMMMHMHHHHV:'. .IHWW    " << endl;
        cout << "      '.  ..:..:.:IHHHHHMMHV" .AVMHMA.:.'VHMMMMHHHHHV:' .  :IHWV   " << endl;
        cout << "      :.  .:...:".:.:TPP"   .AVMMHMMA.:. "VMMHHHP.:... .. :IVAI  " << endl;
        cout << "     .:.   '... .:"'   .   ..HMMMHMMMA::. ."VHHI:::....  .:IHW'   " << endl;
        cout << "      ...  .  . ..:IIPPIH: ..HMMMI.MMMV:I:.  .:ILLH:.. ...:I:IM     " << endl;
        cout << "      : .   .'"' .:.V". .. .  :HMMM:IMMMI::I. ..:HHIIPPHI::'.P:HM.    " << endl; 
        cout << "    :.  .  .  .. ..:.. .    :AMMM IMMMM..:...:IV":T::I::.".:IHIMA " << endl;
        cout << "    'V:.. .. . .. .  .  .   'VMMV..VMMV :....:V:.:..:....::IHHHMH     " << endl;
        cout << "    "IHH:.II:.. .:. .  . . . " :HB"" . . ..PI:.::.:::..:IHHMMV"    " << endl;
        cout << "     :IP""HHII:.  .  .    . . .'V:. . . ..:IH:.:.::IHIHHMMMMM"     " << endl;
        cout << "       :V:. VIMA:I..  .     .  . .. . .  .:.I:I:..:IHHHHMMHHMMM     " << endl;
        cout << "      :"VI:.VWMA::. .:      .   .. .:. ..:.I::.:IVHHHMMMHMMMMI     " << endl;
        cout << "      :."VIIHHMMA:.  .   .   .:  .:.. . .:.II:I:AMMMMMMHMMMMMI     " << endl;
        cout << "       :..VIHIHMMMI...::.,:.,:!"I:!"I!"I!"V:AI:VAMMMMMMHMMMMMM' " << endl;
        cout << "       ':.:HIHIMHHA:"!!"I.:AXXXVVXXXXXXXA:."HPHIMMMMHHMHMMMMMV   " << endl;
        cout << "         V:H:I:MA:W'I :AXXXIXII:IIIISSSSSSXXA.I.VMMMHMHMMMMMM       " << endl;
        cout << "           'I::IVA ASSSSXSSSSBBSBMBSSSSSSBBMMMBS.VVMMHIMM'"'       " << endl;
        cout << "            I:: VPAIMSSSSSSSSSBSSSMMBSSSBBMMMMXXI:MMHIMMI           " << endl;
        cout << "           .I::. "H:XIIXBBMMMMMMMMMMMMMMMMMBXIXXMMPHIIMM'          " << endl;
        cout << "           :::I.  ':XSSXXIIIIXSSBMBSSXXXIIIXXSMMAMI:.IMM            " << endl;
        cout << "           :::I:.  .VSSSSSISISISSSBII:ISSSSBMMB:MI:..:MM            " << endl;
        cout << "           ::.I:.  ':"SSSSSSSISISSXIIXSSSSBMMB:AHI:..MMM.          " << endl;
        cout << "           ::.I:. . ..:"BBSSSSSSSSSSSSBBBMMMB:AHHI::.HMMI          " << endl;
        cout << "           :..::.  . ..::":BBBBBSSBBBMMMB:MMMMHHII::IHHMI          " << endl;
        cout << "           ':.I:... ....:IHHHHHMMMMMMMMMMMMMMMHHIIIIHMMV"          " << endl;
        cout << "            "V:. ..:...:.IHHHMMMMMMMMMMMMMMMMHHHMHHMHP'            " << endl;
        cout << "              ':. .:::.:.::III::IHHHHMMMMMHMHMMHHHHM"              " << endl;
        cout << "               "::....::.:::..:..::IIIIIHHHHMMMHHMV"              " << endl;
        cout << "                 "::.::.. .. .  ...:::IIHHMMMMHMV"                " << endl;
        cout << "                   "V::... . .I::IHHMMV"'                         " << endl;
        cout << "                     '"VHVHHHAHHHHMMV:"'                          " << endl;
            
    
    
    }
    
    
    void flipoff () {            
    	cout << "      .--.   ||   " << endl;
    	cout << "     /    \ _||  " << endl;
    	cout << "     q .. p \ /  " << endl;
    	cout << "      \--/  //   " << endl;
    	cout << "     __||__//     " << endl;
    	cout << "   /.    _/       " << endl;
    	cout << "   // \  /       " << endl;
    	cout << "  //   ||         " << endl;
    	cout << "  \\  /  \     " << endl;
    	cout << "   )\|    |      " << endl;
    	cout << "  / || || |       " << endl;
    	cout << "  |/\| || |      " << endl;
    	cout << "     | || |       " << endl;
    	cout << "     \ || /      " << endl;
    	cout << "   __/ || \__    " << endl;
    	cout << "  \____/____/   " << endl;
    }
    
    void woo () {
    	cout << " .==================================================================. " << endl;
    	cout << " ||    ( )              ( )                ( )              ( )    || " << endl;
    	cout << " |'================================================================'| " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                  .::::.                        || " << endl;
    	cout << " ||                                .::::::::.                      || " << endl;
    	cout << " ||                                :::::::::::                     || " << endl;
    	cout << " ||                                ':::::::::::..                  || " << endl;
    	cout << " ||                                 :::::::::::::::'               || " << endl;
    	cout << " ||                                  ':::::::::::.                 || " << endl;
    	cout << " ||                                    .::::::::::::::'            || " << endl;
    	cout << " ||                                  .:::::::::::...               || " << endl;
    	cout << " ||                                 ::::::::::::::''               || " << endl;
    	cout << " ||                     .:::.       '::::::::''::::                || " << endl;
    	cout << " ||                   .::::::::.      ':::::'  '::::               || " << endl;
    	cout << " ||                  .::::':::::::.    :::::    '::::.             || " << endl;
    	cout << " ||                .:::::' ':::::::::. :::::      ':::.            || " << endl;
    	cout << " ||              .:::::'     ':::::::::.:::::       '::.           || " << endl;
    	cout << " ||            .::::''         '::::::::::::::       '::.          || " << endl;
    	cout << " ||           .::''              '::::::::::::         :::...      || " << endl;
    	cout << " ||        ..::::                  ':::::::::'        .:' ''''     || " << endl;
    	cout << " ||     ..''''':'                    ':::::.'                      || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " ||                                                                || " << endl;
    	cout << " |'================================================================'| " << endl;
    }
    
    int main () {
    
        system ("COLOR 0A");
    
    	int playerhand = 0;
    	int dealerhand = 0;
    	int card;
    	int option = 1;
    
    	srand( time(0) );
    
    	playerhand += getCard();
    	playerhand += getCard();
    
    	dealerhand += getCard ();
    	dealerhand += getCard ();
    
    	while ( dealerhand <= 15 ) {
    		dealerhand += getCard ();
    	}
    		
    	// option 1: hit
    	// option 2: stay
    	while ( option != 2 && playerhand < 21 ) {
    		cout << "Your Hand: " << playerhand << endl;
    		cout << "What would you like to do?" << endl;
    		cout << "1 (Hit) or 2 (Stay): " << endl;
    		cin >> option;
    
    		if (option==1){
    			playerhand += getCard ();
    		}
    	}
    
    
    	if (playerhand == 21) {
    		woo ();
    		//cout << "You Win!!!!" << endl;
    	
            for (int i=0; i<10; i++) {
    			cout << "You Win with a 21!!!!" << endl;
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    		}
    	}
    
    	 else if (dealerhand == 21) {
            skull ();
    		cout << "You Lose!!!! HAHA YOU SUCK!" << endl;
    	}
    
    	  else if ( playerhand == dealerhand) {
    		flipoff ();
    		cout <<  "YOU DRAW!!!!" << endl;
    	}
    
    	  else if ( playerhand > dealerhand && playerhand <= 21) {
            woo ();
    		cout << "You Win" << endl;
    	
              for (int i=0; i<10; i++) {
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    			system ("COLOR 0F");
    			system ("COLOR A0");
    			system ("COLOR F0");
    			system ("COLOR 0A");
    		}
    	}
    
    	 else if ( playerhand < dealerhand) {
    		skull ();
    		cout << "You Lose!!! HAHA YOU SUCK" << endl;
    	}
    
    	 else if (playerhand > 21) {
            skull ();
    		cout << "BUST! You Lose with a hand of " << playerhand << "!!!" << endl;
    	}
    
    	 else if (dealerhand > 21) {
    		cout << "Dealer Got BUST You Win!!!" <<endl;
    	}
    
    	system ("PAUSE");
    	return 0;
    }
    Last edited by skittlznick2; 08-02-2008 at 07:00 PM.

  2. #2
    dkzeria's Avatar
    Join Date
    Aug 2008
    Location
    End of a Rainbow
    Posts
    258
    Reputation
    10
    Thanks
    16
    lol <3 the images but i cant run it :\

  3. #3
    GOD's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Location
    I am the God
    Posts
    11,084
    Reputation
    15
    Thanks
    1,517
    My Mood
    Amazed
    i cant run it lol... something is wrong..

    and lol at the pics
    I am the God.

  4. #4
    elitetech's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    Did you guys see the compile errors? Try to fix it this will be great practice for you.

  5. #5
    skittlznick2's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Location
    YOUR MOM KNOWS
    Posts
    87
    Reputation
    10
    Thanks
    8
    To fix most of these errors you can fix the images yourself might take awhile tho.Other than that its perfect i just ran it.

  6. #6
    scapecoolioboy's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    277
    Reputation
    10
    Thanks
    35
    lmao wierd i cant run nice pics

  7. #7
    skittlznick2's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Location
    YOUR MOM KNOWS
    Posts
    87
    Reputation
    10
    Thanks
    8
    The only reason you cant run it is because of the jacked up pictures.

    Fix them if you wanna run or forget the pictures and just sutdy the commands.

  8. #8
    scapecoolioboy's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    277
    Reputation
    10
    Thanks
    35
    okay but it took me like 50 mins to move it all my first progam in c++ lol

Similar Threads

  1. [SOLVED]is there anyone someone could help me get unbanned from mw2 multiplayer
    By Devin7713 in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 07-30-2010, 02:31 PM
  2. Im so Noobb! anyone could help a feloow hacker
    By kingking12 in forum Combat Arms Help
    Replies: 5
    Last Post: 07-28-2010, 10:44 AM
  3. Hi guys I was wondering if you could help me out :)
    By realboy in forum Member Introduction & Return
    Replies: 4
    Last Post: 05-26-2010, 07:51 PM
  4. [Help] paint.net users..
    By Tyler930 in forum Combat Arms Mod Discussion
    Replies: 4
    Last Post: 04-18-2010, 04:59 AM
  5. [Please Sticky] Numpad Help For Laptop Users
    By Acen in forum Combat Arms Hacks & Cheats
    Replies: 46
    Last Post: 08-21-2009, 09:30 AM

Tags for this Thread