Random Thoughts.....What Are You Thinking?

Eorzea Time
 
 
 
Langues: JP EN FR DE
users online
Forum » Everything Else » Undead » Random Thoughts.....What are you thinking?
Random Thoughts.....What are you thinking?
First Page 2 3 ... 5444 5445 5446 ... 22718 22719 22720
Offline
Posts: 7851
By Irohuro 2012-04-22 07:00:21
Link | Citer | R
 
i also use cpu monitor, weather, and gpu monitor widgets >__>

edit: new page, so i'm gonna throw down some code =D
Code
#include <iostream>
#include <ctime>

using namespace std;

//function prototypes
void printLines();   //prints the seperation lines.
void showTitle();    // Title header.
void callMenu(int &selection);  //shows the main menu.
int getRandomNum();       //for the player. generates a random number 1-11.
int getCompRandomNum();   //for the computer. generates a random number between 10-21.

int main()
{
	//variables
	int menuSelect = 0;
	int hitSelect = 0;
	int playerRandNum = 0;
	int compTotal = 0;
	int playerTotal = 0;

	//game info
	printLines();   //this section shows the title header
	showTitle();
	printLines();

	//main menu and game process
	
	while(menuSelect != 2)   //this while statment controls the entire game repeat.
	{                        //the game will always go back to the main menu when finished 
		callMenu(menuSelect);  //so that the player can choose to play a new game or exit.
		printLines();

		if(menuSelect == 1) //this if statement lets the program skip the game if the player chooses to exit.
		{
			
			
			while(hitSelect != 2)
			{
				while(hitSelect != 2) //this while statement lets the player go as many times as they wish to get
				{                     //as close to 21 as they can.
					cout << "Would you like to (1) Hit or (2) Stay? ";
					cin >> hitSelect;

					if(hitSelect == 1) //this if statement means that if the player chooses to stay, then the game 
					{                  // wont process the random number generation an extra time.
						playerRandNum = getRandomNum();
						playerTotal += playerRandNum;		

						cout << "Player Total: " << playerTotal << endl;
					}// endif

				}//endwhile

				compTotal = getCompRandomNum();         //this generates the the number for the computer's hand.

				cout << "Computer Total: " << compTotal << endl;

 
			}//endwhile
		 
			if(playerTotal == compTotal) //this if statement indicates that if there is a tie,
			{                                        //then the computer should display that it is a tie.
				cout << "It's a tie!" << endl;
			}//endif
			if(playerTotal == 21 || playerTotal > compTotal && playerTotal < 22 && playerTotal != compTotal)
			{                                                                  //this if statement is for displaying the winning 
				cout << "Congratulations, you win!" << endl;                   //text if the player gets 21 or a number higher than the computer.
			}//endif
			if(playerTotal < compTotal || playerTotal > 21)   //this if statment indicates that none of the other conditions were met, which means the player has lost.
			{
				cout << "You lost!" << endl;
			}//endif
		

			//clear variables
			hitSelect = 0;             //this section clears
			playerTotal = 0;           //out the variables so
			compTotal = 0;             //that the numbers from
 			playerRandNum = 0;         //the previous game won't interfere.
			printLines();              //prints a dividing line between the last game and the main menu.
		}//endif

	}//endwhile
				


	return 0;
}//end of main function

//*****function definitions - void functions*****
void printLines()
{
	cout << "--------------------" << endl;
} //end of printLines

void showTitle()
{
	cout << "***SIMPLE BLACKJACK***" << endl;
	cout << "written by Cody Warren" << endl;
} //end showTitle


void callMenu(int &selection)
{
	cout << "*****MAIN MENU*****" << endl;
	cout << "1. Play" << endl;
	cout << "2. Exit" << endl;

	printLines();

	cout << "What would you like to do? ";
	cin >> selection;
} //end callMenu

//*****function definitions - value returning functions*****
int getRandomNum()
{
	int num = 0;

	srand(static_cast<int>(time(0)));
	num = 1 + rand() % (11 - 1 + 1);

	return num;
} //end getRandomNum

int getCompRandomNum()
{
	int compNum = 0;

	srand(static_cast<int>(time(0)));
	compNum = 10 + rand() % (21 - 10 + 1);

	return compNum;
} //end getCompRandomNum
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:04:17
Link | Citer | R
 
I have all my calendar *** (like dr appointments and if I do have a test or class) on my iPod and my phone.
 Ramuh.Austar
Offline
Serveur: Ramuh
Game: FFXI
user: Austar
Posts: 10480
By Ramuh.Austar 2012-04-22 07:07:22
Link | Citer | R
 
how the *** can i be 0/14 on genbu's shield?
 Asura.Chuuuuu
Online
Serveur: Asura
Game: FFXI
user: chuuuuu
Posts: 19923
By Asura.Chuuuuu 2012-04-22 07:29:14
Link | Citer | R
 
I think its always a bad idea to post this early in the morning lol
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:30:36
Link | Citer | R
 
Asura.Chuuuuu said: »
I think its always a bad idea to post this early in the morning lol


Early? It's 8:30AM! (I dunno what time it is cali time, like ... 2AM?)
Offline
Posts: 7851
By Irohuro 2012-04-22 07:32:23
Link | Citer | R
 
/hi5 EST
[+]
 Bismarck.Dreadnot
Offline
Serveur: Bismarck
Game: FFXI
Posts: 5113
By Bismarck.Dreadnot 2012-04-22 07:37:04
Link | Citer | R
 
Iro Huro said: »
/hi5 EST

/brofist

*sips coffee*
Offline
Posts: 7851
By Irohuro 2012-04-22 07:39:05
Link | Citer | R
 
"drinks sweet tea and eats a jimmy dean breakfast bowl*
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:42:21
Link | Citer | R
 
*sips water and eats ...*


yeah I haven't really eaten anything yet lol, grandmother is going to be making uh ... cinnamon rolls once she picks up my bro.
Offline
Posts: 7851
By Irohuro 2012-04-22 07:44:20
Link | Citer | R
 
Leviathan.Catnipthief said: »
*sips water and eats ...*


yeah I haven't really eaten anything yet lol, grandmother is going to be making uh ... cinnamon rolls once he picks up my bro.

O.o

my mom and aunt will be making sunday breakfast soon.
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:45:41
Link | Citer | R
 
I live with my grandparents lol, my mom is a druggie >.>
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:46:30
Link | Citer | R
 
OH WAIT :o


*fixes post*
Offline
Posts: 7851
By Irohuro 2012-04-22 07:46:42
Link | Citer | R
 
i was pointing out the misuse of third person singular pronouns =/

edit: there you go. leaving the quote in to immortalize your fail though =)
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 07:47:08
Link | Citer | R
 
shhhhhhhhhhhhhhhhhhhhhhhhhhh



I got a headache lol.
Offline
Posts: 7851
By Irohuro 2012-04-22 07:48:32
Link | Citer | R
 
i've been up for about 17 hours now.

your avi reminds me of the gif with whats-her-face and whats-his-face with whats-her-face's face on both of their faces.
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 08:27:34
Link | Citer | R
 
I have 7 bucks left ... I think I know what I need to get! a new HDMI cable!
 Asura.Alymorel
Offline
Serveur: Asura
Game: FFXI
user: Alimorel
Posts: 4560
By Asura.Alymorel 2012-04-22 08:49:55
Link | Citer | R
 
Ugh. Hate having to wake up early. ; ;
 Ramuh.Sagittario
Offline
Serveur: Ramuh
Game: FFXI
user: Sagi
Posts: 16303
By Ramuh.Sagittario 2012-04-22 08:58:36
Link | Citer | R
 
Asura.Alymorel said: »
Ugh. Hate having to wake up early. ; ;

I share your misery, I had to get up at 5am this morning and ended up only getting two hours sleep. On top of the 5 hours I got the night before... an I won't get much tonight because I'll be up playing teh BEAUTIFUL Tera :p
 Phoenix.Lillicarnage
Offline
Serveur: Phoenix
Game: FFXI
user: Lillica
Posts: 4195
By Phoenix.Lillicarnage 2012-04-22 09:24:47
Link | Citer | R
 
I would go back to bed, but The Office marathon. (US version)
 Leviathan.Catnipthief
Offline
Serveur: Leviathan
Game: FFXI
user: Fyyvoaa
Posts: 18930
By Leviathan.Catnipthief 2012-04-22 10:28:36
Link | Citer | R
 
mmm pasta for lunch :3
 Shiva.Spathaian
Offline
Serveur: Shiva
Game: FFXI
user: Spathaian
Posts: 27982
By Shiva.Spathaian 2012-04-22 11:49:29
Link | Citer | R
 
/lesigh

Good morning, everyone. How are you all today?
 Ramuh.Urial
Offline
Serveur: Ramuh
Game: FFXI
user: Urial
Posts: 31068
By Ramuh.Urial 2012-04-22 11:58:07
Link | Citer | R
 
So I decided to buy juice boxes for some random reason while I was at the grocery store this morning.

I nostalgia'd hard just a second ago when I had the first one...
[+]
 Asura.Ina
Offline
Serveur: Asura
Game: FFXI
user: Inasura
Posts: 17912
By Asura.Ina 2012-04-22 12:00:36
Link | Citer | R
 
Morning Spath, I'm doing ok how about you?

Ramuh.Urial said: »
So I decided to buy juice boxes for some random reason while I was at the grocery store this morning.

I nostalgia'd hard just a second ago when I had the first one...
Damn you... now I want a juice box XD
[+]
 Ramuh.Urial
Offline
Serveur: Ramuh
Game: FFXI
user: Urial
Posts: 31068
By Ramuh.Urial 2012-04-22 12:02:53
Link | Citer | R
 
I even nostalgia'd at that annoying air straw bubble at the end noise.
It was bad.
[+]
 Shiva.Spathaian
Offline
Serveur: Shiva
Game: FFXI
user: Spathaian
Posts: 27982
By Shiva.Spathaian 2012-04-22 12:05:24
Link | Citer | R
 
I'm ok. Just really don't wanna do homework right now. Why must I be required to write an annotated bibliography as an assignment by itself? :/

I can understand that the teacher wants us to be prepared but I feel I know what I'm doing already when it comes to source hunting and forcing me to write one so early is silly.

>.> I swear this class is just a bunch of busy work at times just because it's required and the teacher doesn't know what she's doing.
 Cerberus.Draupnir
Offline
Serveur: Cerberus
Game: FFXI
user: Draupnir
Posts: 2119
By Cerberus.Draupnir 2012-04-22 12:05:35
Link | Citer | R
 
That awkward moment when you wake up at 5:30 am thinking you have to get up for work...then realizing it's your day off >.>
[+]
 Asura.Lolserj
Offline
Serveur: Asura
Game: FFXI
user: Andras
Posts: 2956
By Asura.Lolserj 2012-04-22 12:42:16
Link | Citer | R
 
Iro Huro said: »
i also use cpu monitor, weather, and gpu monitor widgets >__>

edit: new page, so i'm gonna throw down some code =D
Code
#include <iostream>
#include <ctime>

using namespace std;

//function prototypes
void printLines();   //prints the seperation lines.
void showTitle();    // Title header.
void callMenu(int &selection);  //shows the main menu.
int getRandomNum();       //for the player. generates a random number 1-11.
int getCompRandomNum();   //for the computer. generates a random number between 10-21.

int main()
{
	//variables
	int menuSelect = 0;
	int hitSelect = 0;
	int playerRandNum = 0;
	int compTotal = 0;
	int playerTotal = 0;

	//game info
	printLines();   //this section shows the title header
	showTitle();
	printLines();

	//main menu and game process
	
	while(menuSelect != 2)   //this while statment controls the entire game repeat.
	{                        //the game will always go back to the main menu when finished 
		callMenu(menuSelect);  //so that the player can choose to play a new game or exit.
		printLines();

		if(menuSelect == 1) //this if statement lets the program skip the game if the player chooses to exit.
		{
			
			
			while(hitSelect != 2)
			{
				while(hitSelect != 2) //this while statement lets the player go as many times as they wish to get
				{                     //as close to 21 as they can.
					cout << "Would you like to (1) Hit or (2) Stay? ";
					cin >> hitSelect;

					if(hitSelect == 1) //this if statement means that if the player chooses to stay, then the game 
					{                  // wont process the random number generation an extra time.
						playerRandNum = getRandomNum();
						playerTotal += playerRandNum;		

						cout << "Player Total: " << playerTotal << endl;
					}// endif

				}//endwhile

				compTotal = getCompRandomNum();         //this generates the the number for the computer's hand.

				cout << "Computer Total: " << compTotal << endl;

 
			}//endwhile
		 
			if(playerTotal == compTotal) //this if statement indicates that if there is a tie,
			{                                        //then the computer should display that it is a tie.
				cout << "It's a tie!" << endl;
			}//endif
			if(playerTotal == 21 || playerTotal > compTotal && playerTotal < 22 && playerTotal != compTotal)
			{                                                                  //this if statement is for displaying the winning 
				cout << "Congratulations, you win!" << endl;                   //text if the player gets 21 or a number higher than the computer.
			}//endif
			if(playerTotal < compTotal || playerTotal > 21)   //this if statment indicates that none of the other conditions were met, which means the player has lost.
			{
				cout << "You lost!" << endl;
			}//endif
		

			//clear variables
			hitSelect = 0;             //this section clears
			playerTotal = 0;           //out the variables so
			compTotal = 0;             //that the numbers from
 			playerRandNum = 0;         //the previous game won't interfere.
			printLines();              //prints a dividing line between the last game and the main menu.
		}//endif

	}//endwhile
				


	return 0;
}//end of main function

//*****function definitions - void functions*****
void printLines()
{
	cout << "--------------------" << endl;
} //end of printLines

void showTitle()
{
	cout << "***SIMPLE BLACKJACK***" << endl;
	cout << "written by Cody Warren" << endl;
} //end showTitle


void callMenu(int &selection)
{
	cout << "*****MAIN MENU*****" << endl;
	cout << "1. Play" << endl;
	cout << "2. Exit" << endl;

	printLines();

	cout << "What would you like to do? ";
	cin >> selection;
} //end callMenu

//*****function definitions - value returning functions*****
int getRandomNum()
{
	int num = 0;

	srand(static_cast<int>(time(0)));
	num = 1 + rand() % (11 - 1 + 1);

	return num;
} //end getRandomNum

int getCompRandomNum()
{
	int compNum = 0;

	srand(static_cast<int>(time(0)));
	compNum = 10 + rand() % (21 - 10 + 1);

	return compNum;
} //end getCompRandomNum

is this a dice game or something?
 
Offline
Posts:
By 2012-04-22 12:54:16
 Undelete | Edit  | Link | Citer | R
 
Post deleted by User.
 Alexander.Drokin
Offline
Serveur: Alexander
Game: FFXI
user: drokin
Posts: 2740
By Alexander.Drokin 2012-04-22 13:03:33
Link | Citer | R
 
Asura.Lolserj said: »

is this a dice game or something?

Blackjack.
 Kujata.Daus
Offline
Serveur: Kujata
Game: FFXI
user: Daus
Posts: 3451
By Kujata.Daus 2012-04-22 13:18:06
Link | Citer | R
 
the awkward moment where you want to post something funny on facebook but you can't because somebody your entire facebook knows just died and you think it might be in bad taste.
[+]
First Page 2 3 ... 5444 5445 5446 ... 22718 22719 22720