All pastes #546804 Raw Edit

IronStrike

public cpp v1 · immutable
·published 2007-06-07 05:06 UTC
rendered paste body
#include<iostream.h>#include<math.h>#include<time.h>#include<stdlib.h>#include<conio.h>#include<windows.h>void DrawBar(int Length, const char mark= char(177))    {    	for (int i=0; i<Length; i++)    		cout << mark;    		cout << endl;	}void setcolor(unsigned short color)    {		HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);		SetConsoleTextAttribute(hcon,color);	}int main()    {    	setcolor(2);    	//Sets up stuff for random numbers    	srand((unsigned)time(NULL));    	//Sets up tokens and jackpot    	int jackpot = 5;    	int tokens = 1000;    			//Displays Title		DrawBar(80);    	cout << "\tS\tL\tO\tT\tS" << endl;    	DrawBar(80);    	char choice;		        	do {        		//Displays Choices and tokens and jackpot amounts        		cout << endl <<"Tokens:" << tokens << endl;        		cout << "JACKPOT = " << jackpot << endl;        		cout << "--[P]ull or [Q]uit--" << endl;        		cin >> choice;            		if (choice == 'P' || choice == 'p')                     //    a  b  c    \-/					{														//    d  e  f    -X- Later will make 1x 3x 5x            			tokens--;											//    g  h  i    /-\				  				  				  int slota;				  slota = rand()%6;                  int slotb;                  slotb = rand()%6;                  int slotc;                  slotc = rand()%6;			/*	  int slotd;				  slota = rand()%6;                  int slote;                  slotb = rand()%6;                  int slotf;                  slotc = rand()%6;				  int slotg;				  slota = rand()%6;                  int sloth;                  slotb = rand()%6;                  int sloti;                  slotc = rand()%6;			*/										char symbols[] = "$@*!&";				//	int values[5] = {12,20,30,40,50};								  	char syma = symbols[slota];					char symb = symbols[slotb];					char symc = symbols[slotc];			               /*   char symd = symbols[slotd];					char syme = symbols[slote];					char symf = symbols[slotf];				  	char symg = symbols[slotg];					char symh = symbols[sloth];					char symi = symbols[sloti];				*/							jackpot += 1;            			DrawBar(80);            			//Displays the slots            			cout << endl << "[" << syma << "]" << " " << "[" << symb << "]" << " " << "[" << symc << "]" << endl;					/*	cout << endl << "[" << symd << "]" << " " << "[" << syme << "]" << " " << "[" << symf << "]" << endl;						cout << endl << "[" << symg << "]" << " " << "[" << symh << "]" << " " << "[" << symi << "]" << endl;            		*/												//wining     												if (slota == slotb && slotb == slotc && slotc == slota) 							{									cout << "You Win " << slota <<" Tokens" << endl;                							cout << endl;                							tokens += slota;                							DrawBar(80);                				/*	if(slotd == 3)										{											cout << "You Win 3 Tokens" << endl;                							cout << endl;                							tokens += 3;                							DrawBar(80);										}											else if (slotd == 2)											{												cout << "You Win 2 Tokens" << endl;                								cout << endl;												tokens +=2;												DrawBar(80);											}												else if (slotd == 1)												{													cout << "You Win 1 Token" << endl;                									cout << endl;													tokens +=1;													DrawBar(80);												}*/                			}																									else {                        							cout << "You won nothing" << endl;							cout << endl;							DrawBar(80);								 }					 }					/*	else if (choice !='P' || choice !='p' || choice !='Q' || choice !='q')							{							cout << "Please Enter A Valid Command";							cout << endl;							}					*/										//Requirments ending the loop            } 						while ((choice !='q') && (choice !='Q') && (tokens!=0));            //Ending comments            cout << "You left the Casino with " << tokens << " tokens!" << endl;            // system("PAUSE");            return 0;    }