<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flock of Cats &#187; Stuff</title>
	<atom:link href="http://www.flockofcats.com/category/stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flockofcats.com</link>
	<description>Politics, Video Games, Japan, Random Stuff, Etc</description>
	<lastBuildDate>Tue, 28 Sep 2010 17:16:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fuck</title>
		<link>http://www.flockofcats.com/sneaky/meta/fuck/</link>
		<comments>http://www.flockofcats.com/sneaky/meta/fuck/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 16:06:38 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/sneaky/meta/fuck/</guid>
		<description><![CDATA[I just wrote a long blog post and my iPhone ate it. I give up, I&#8217;m going to bed. おやすみ♪
]]></description>
			<content:encoded><![CDATA[<p>I just wrote a long blog post and my iPhone ate it. I give up, I&#8217;m going to bed. おやすみ♪</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/meta/fuck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackJack</title>
		<link>http://www.flockofcats.com/sneaky/stuff/blackjack/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/blackjack/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 11:22:01 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=886</guid>
		<description><![CDATA[I made a blackjack game in C++. You can click the link to download the game (probably only works on windows). You can see the source code after the jump.


#include &#60;iostream&#62;		//for basic input/output
#include &#60;string&#62;		//for strings
#include &#60;cstdlib&#62;		//for...I forgot...the random number?
#include &#60;ctime&#62;		//for seeding random number with clock
#include &#60;windows.h&#62;	//for colors
#include &#34;colors.h&#34;		//include color definitions

using namespace std;

#define HEARTS &#34;H&#34;		//define suits
#define [...]]]></description>
			<content:encoded><![CDATA[<p>I made a <a href="http://www.flockofcats.com/Blackjack.exe">blackjack game in C++</a>. You can click the link to download the game (probably only works on windows). You can see the source code after the jump.</p>
<p><span id="more-886"></span></p>
<pre class="brush: cpp;">
#include &lt;iostream&gt;		//for basic input/output
#include &lt;string&gt;		//for strings
#include &lt;cstdlib&gt;		//for...I forgot...the random number?
#include &lt;ctime&gt;		//for seeding random number with clock
#include &lt;windows.h&gt;	//for colors
#include &quot;colors.h&quot;		//include color definitions

using namespace std;

#define HEARTS &quot;H&quot;		//define suits
#define DIAMONDS &quot;D&quot;
#define CLUBS &quot;C&quot;
#define SPADES &quot;S&quot;

void clear_screen ( void )	//Function to clear the screen
{
  DWORD n;                         /* Number of characters written */
  DWORD size;                      /* number of visible characters */
  COORD coord = {0};               /* Top left screen position */
  CONSOLE_SCREEN_BUFFER_INFO csbi;

  /* Get a handle to the console */
  HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );

  GetConsoleScreenBufferInfo ( h, &amp;csbi );

  /* Find the number of characters to overwrite */
  size = csbi.dwSize.X * csbi.dwSize.Y;

  /* Overwrite the screen buffer with whitespace */
  FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &amp;n );
  GetConsoleScreenBufferInfo ( h, &amp;csbi );
  FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &amp;n );

  /* Reset the cursor to the top left position */
  SetConsoleCursorPosition ( h, coord );
}

struct card {  //info for one card
string face;
string suit;
int value;

};

void make_deck(card deck[]) { //fill the deck with cards

card * deck_p;

deck_p=deck;
int counter=0;
for (int i=0; i&lt;4; i++){
	for (int j=0; j&lt;13; j++){

		if (j==0) { deck_p-&gt;value = 11; deck_p-&gt;face = &quot;A&quot;;}
		if ((j&gt;0) &amp;&amp; (j&lt;9)) {deck_p-&gt;value = j+1; deck_p-&gt;face = j+49;}
		if (j==9) { deck_p-&gt;value = 10; deck_p-&gt;face = &quot;10&quot;;}
		if (j==10) { deck_p-&gt;value = 10; deck_p-&gt;face = &quot;J&quot;;}
		if (j==11) { deck_p-&gt;value = 10; deck_p-&gt;face = &quot;Q&quot;;}
		if (j==12) { deck_p-&gt;value = 10; deck_p-&gt;face = &quot;K&quot;;}

		if (i==0) {deck_p-&gt;suit = HEARTS;}
		if (i==1) {deck_p-&gt;suit = DIAMONDS;}
		if (i==2) {deck_p-&gt;suit = CLUBS;}
		if (i==3) {deck_p-&gt;suit = SPADES;}
		deck_p++;
			}
		}
}

void shuffle_deck(card deck[]) { // exchange two cards (SHUFFLE number of times)

	card temp;
	const int SHUFFLE = 200;	//define number of shuffles
    int random1=0;
	int random2=0;
    int lowest=0, highest=51;
    int range=(highest-lowest)+1;

	for (int n=0; n&lt; SHUFFLE; n++) {
		random1 = lowest+int(range*rand()/(RAND_MAX + 1.0));
		random2 = lowest+int(range*rand()/(RAND_MAX + 1.0));
	temp = deck[random1];
	deck[random1]=deck[random2];
	deck[random2]=temp;
	}
	cout &lt;&lt;endl &lt;&lt; &quot;New deck!! Shuffling!&quot; &lt;&lt;endl&lt;&lt;endl;
	Sleep(1000);
}

class hand_c { //define class for manipulating player and dealer hands

	card hand[20];	//I tried to make this a dynamic array but gave up and just defined a constant array of 20, which is more than enough for a Blackjack hand
	int ace_count;	//For counting number of aces to adjust value to 1 or 11
	int hand_value;	//Total value of hand

public:
	int hand_count;	//Number of cards in hand
	bool blackjack;	//True if hand is Blackjack

int calc_hand_value () {  //function for calculating value of hand

	hand_value=0;
	ace_count=0;

	for (int j=0; j&lt;hand_count; j++)
		hand_value+=hand[j].value;

	for (int k=0; k&lt;hand_count; k++) {
		if (hand[k].face==&quot;A&quot;)
			ace_count++; }
	for (int m=1; m&lt;=ace_count; m++)
	{if (hand_value &gt; 21) hand_value-=10;} //subtract 10 for each ace if hand value is over 21, thus taking ace as 1

	return (hand_value);

}

int hidden_hand_value () {	//calculate the value excluding first card

	hand_value=hand[1].value;

	return (hand_value);

}

void get_deal(card deck[], int &amp;dealt_cards) {	//perform initial deal of two cards to player and dealer

	hand_count=0;
	hand_value=0;
	blackjack=false;

	if (dealt_cards == 52) {		//check that there are enough cards, if not, shuffle new deck
			make_deck(deck);
			shuffle_deck(deck);
			dealt_cards=0;
			cout &lt;&lt;endl &lt;&lt; &quot;...New deck!! Re-shuffling!&quot; &lt;&lt;endl&lt;&lt; endl;
			Sleep(1000);}

	hand[0]=deck[dealt_cards];	//deal first card
	dealt_cards++;
	hand_count++;

	if (dealt_cards == 52) {
			make_deck(deck);
			shuffle_deck(deck);
			dealt_cards=0;
			cout &lt;&lt;endl &lt;&lt; &quot;...New deck!! Re-shuffling!&quot; &lt;&lt;endl&lt;&lt;endl;
			Sleep(1000);}

	hand[1]=deck[dealt_cards];	//deal second card
	dealt_cards++;
	hand_count++;

	for (int j=0; j&lt;hand_count; j++)
		hand_value+=hand[j].value;

	if (hand_value==21)		//check for blackjack
		blackjack=true;
	}

void print_hand() {

	 HANDLE hOut;								//shit for color
	 hOut = GetStdHandle(STD_OUTPUT_HANDLE);

for (int k=0; k&lt;hand_count; k++)
{
	if ((hand[k].suit==HEARTS)||(hand[k].suit==DIAMONDS))  //print red face of card
	{
		cout &lt;&lt;&quot;  &quot;;
		SetConsoleTextAttribute (hOut, BWI | FRI);
		cout.width(2);
		cout&lt;&lt; hand[k].face &lt;&lt;&quot;      &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
	else						//print black face of cards
	{
		cout &lt;&lt;&quot;  &quot;;
		SetConsoleTextAttribute (hOut, BWI | FNULL);
		cout.width(2);
		cout&lt;&lt; hand[k].face &lt;&lt;&quot;      &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
	}

	cout &lt;&lt; endl;
	for (int k=0; k&lt;hand_count; k++)  //print white space
		{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BWI | FRI); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
	cout &lt;&lt; endl;
	for (int k=0; k&lt;hand_count; k++)	//print white space
		{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BWI | FRI); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
	cout &lt;&lt; endl;

	for (int k=0; k&lt;hand_count; k++) {
		if ((hand[k].suit==HEARTS)||(hand[k].suit==DIAMONDS)) { //print red suits
			cout &lt;&lt;&quot;  &quot;;
			SetConsoleTextAttribute (hOut, BWI | FRI);
			cout.width(7);
			cout&lt;&lt; hand[k].suit &lt;&lt; &quot; &quot;&lt;&lt; flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
		else {									//print black suits
			cout &lt;&lt;&quot;  &quot;;
			SetConsoleTextAttribute (hOut, BWI | FNULL);
			cout.width(7);
			cout&lt;&lt; hand[k].suit &lt;&lt; &quot; &quot; &lt;&lt; flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
		}
		cout &lt;&lt;endl;

	}

void print_hidden_hand() {		//as above, but hide first card, print it blue

	 HANDLE hOut;
	 hOut = GetStdHandle(STD_OUTPUT_HANDLE);

for (int k=0; k&lt;hand_count; k++)
{

	if (k==0)
	{
		cout &lt;&lt;&quot;  &quot;;
		SetConsoleTextAttribute (hOut, BB | FNULL);
		cout&lt;&lt; &quot;        &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
	else if ((hand[k].suit==HEARTS)||(hand[k].suit==DIAMONDS))
	{
		cout &lt;&lt;&quot;  &quot;;
		SetConsoleTextAttribute (hOut, BWI | FRI);
		cout.width(2);
		cout&lt;&lt; hand[k].face &lt;&lt;&quot;      &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
	else
	{
		cout &lt;&lt;&quot;  &quot;;
		SetConsoleTextAttribute (hOut, BWI | FNULL);
		cout.width(2);
		cout&lt;&lt; hand[k].face &lt;&lt;&quot;      &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
	}

	cout &lt;&lt; endl;

	for (int k=0; k&lt;hand_count; k++){
		if (k==0)
			{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BB | FB); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
		else
			{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BWI | FRI); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
	}
	cout &lt;&lt; endl;

	for (int k=0; k&lt;hand_count; k++){
		if (k==0)
			{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BB | FB); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
		else
			{SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush; SetConsoleTextAttribute (hOut, BWI | FRI); cout &lt;&lt;&quot;        &quot; &lt;&lt; flush; SetConsoleTextAttribute(hOut, BNULL | FW); cout &lt;&lt; &quot;  &quot; &lt;&lt; flush;}
	}
	cout &lt;&lt; endl;

	for (int k=0; k&lt;hand_count; k++){
		if (k==0){
			cout &lt;&lt;&quot;  &quot;;
			SetConsoleTextAttribute (hOut, BB | FB);
			cout &lt;&lt; &quot;        &quot;&lt;&lt; flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
		else if ((hand[k].suit==HEARTS)||(hand[k].suit==DIAMONDS)){
			cout &lt;&lt;&quot;  &quot;;
			SetConsoleTextAttribute (hOut, BWI | FRI);
			cout.width(7);
			cout&lt;&lt; hand[k].suit &lt;&lt; &quot; &quot;&lt;&lt; flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
		else {
			cout &lt;&lt;&quot;  &quot;;
			SetConsoleTextAttribute (hOut, BWI | FNULL);
			cout.width(7);
			cout&lt;&lt; hand[k].suit &lt;&lt; &quot; &quot; &lt;&lt; flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cout&lt;&lt; &quot;  &quot;&lt;&lt;flush;}
		}

	cout &lt;&lt;endl;

}

void hit (card deck[], int &amp;dealt_cards) {	//add a card for hit

	if (dealt_cards == 52) {	//check there are enough cards to deal, else shuffle new deck
		make_deck(deck);
		shuffle_deck(deck);
		dealt_cards=0;
		cout &lt;&lt;endl &lt;&lt; &quot;...New deck!! Re-shuffling!&quot; &lt;&lt;endl&lt;&lt;endl;
		Sleep(1000);}

	hand[hand_count]=deck[dealt_cards];
	dealt_cards++;
	hand_count++;

}

}player_hand, dealer_hand;  //objects(?) for player and dealer hands

void make_bet ( double &amp;bet,  double &amp;cash) {	//function to get bet

	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

	if (cash!=0) {
		cout &lt;&lt; &quot;You have &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); cout &lt;&lt;&quot;$&quot; &lt;&lt; cash &lt;&lt; flush;  SetConsoleTextAttribute(hOut, BNULL | FW);
			cout &lt;&lt;&quot;. Enter your wager (enter 0 to quit) --&gt; &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI);
			cin &gt;&gt; bet; SetConsoleTextAttribute(hOut, BNULL | FW);}
	else if (cash ==0)	//if no money, set bet as zero to quit
		bet = 0;
	while ( (!cin.good()) || (bet &gt; cash)||(bet &lt; 0))	//check for valid input
	if (!cin.good()) {	//numbers only
		cout &lt;&lt; endl &lt;&lt; &quot;Enter a valid wager. Only money, no abc#$%^&amp; shit, please!&quot; &lt;&lt;endl;
		cout &lt;&lt; &quot;You have &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); cout &lt;&lt;&quot;$&quot; &lt;&lt; cash &lt;&lt; flush;  SetConsoleTextAttribute(hOut, BNULL | FW);
			cout &lt;&lt;&quot;. Enter your wager (enter 0 to quit) --&gt; &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); SetConsoleTextAttribute(hOut, BNULL | FW);;
			cin.clear(); cin.sync(); cin &gt;&gt; bet;
			SetConsoleTextAttribute(hOut, BNULL | FW);}

	else if (bet &gt; cash) {	//check that bet is less than available cash
		cout &lt;&lt; endl &lt;&lt; &quot;Sorry, champ. You don't have enough money.&quot; &lt;&lt;endl;
		cout &lt;&lt; &quot;You have &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); cout &lt;&lt;&quot;$&quot; &lt;&lt; cash &lt;&lt; flush;  SetConsoleTextAttribute(hOut, BNULL | FW);
			cout &lt;&lt;&quot;. Enter your wager (enter 0 to quit) --&gt; &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI);
			cin.clear(); cin.sync();cin &gt;&gt; bet;
			SetConsoleTextAttribute(hOut, BNULL | FW);}

	else if (bet &lt; 0) {	//check for negative bets
		cout &lt;&lt; endl &lt;&lt; &quot;No negative bets, Mr. Smartypants.&quot; &lt;&lt;endl;
		cout &lt;&lt; &quot;You have &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); cout &lt;&lt;&quot;$&quot; &lt;&lt; cash &lt;&lt; flush;  SetConsoleTextAttribute(hOut, BNULL | FW);
			cout &lt;&lt;&quot;. Enter your wager (enter 0 to quit) --&gt; &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI);
			cin.clear(); cin.sync(); cin &gt;&gt; bet;
			SetConsoleTextAttribute(hOut, BNULL | FW); }

	cash=cash-bet;	//deduct bet from cash

}

void win_lose ( double bet,  double &amp;cash, bool bought_ins) {	//check for winner

	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

	if ((dealer_hand.blackjack==true)&amp;&amp;(bought_ins==true)){ //if insurance is bought and dealer Blackjacks, payout
		cout &lt;&lt; &quot;You won &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FGI);
		cout &lt;&lt; &quot;$&quot; &lt;&lt; bet &lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; from insurance!&quot; &lt;&lt; endl &lt;&lt;endl;
	}

	if ((dealer_hand.blackjack==false)&amp;&amp;(bought_ins==true)){ //lose insurance if not dealer blackjack
		cout &lt;&lt; &quot;You lost your insurance of &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FRI);
		cout &lt;&lt; &quot;$&quot; &lt;&lt; bet/2 &lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot;.&quot; &lt;&lt; endl &lt;&lt;endl;
	}

	if (dealer_hand.blackjack==true) {	//player loses if dealer gets BJ
		SetConsoleTextAttribute (hOut, BNULL | FRI);
		cout &lt;&lt; &quot;Dealer got blackjack! &quot; &lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You lost your bet of &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FRI);
		cout&lt;&lt; &quot;-- $&quot; &lt;&lt; bet &lt;&lt;&quot; --&quot;&lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; endl &lt;&lt;endl;
		}

	else if (player_hand.blackjack==true) {		//player wins if BJ
		SetConsoleTextAttribute (hOut, BNULL | FGI);
		cout &lt;&lt; &quot;You got blackjack! &quot; &lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You get back your bet of &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FYI);
		cout&lt;&lt; &quot;$&quot; &lt;&lt; bet&lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FGI);
		cout&lt;&lt; &quot; + $&quot; &lt;&lt; bet*1.5 &lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; in winnings!&quot; &lt;&lt; endl &lt;&lt;endl;
		cash = cash + bet*2.5;
		}

	else if (player_hand.calc_hand_value() &gt; 21) {	//check for player over 21, if bust, player always loses
		SetConsoleTextAttribute (hOut, BNULL | FRI);
		cout &lt;&lt; &quot;Bust! &quot; &lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You lost your bet of &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FRI);
		cout&lt;&lt; &quot;-- $&quot; &lt;&lt; bet &lt;&lt;&quot; --&quot;&lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; endl &lt;&lt;endl;
		}
	else if ((dealer_hand.calc_hand_value() &gt; 21) &amp;&amp; (player_hand.calc_hand_value() &lt;= 21)) {	//if dealer, but not player busts, player wins
		SetConsoleTextAttribute (hOut, BNULL | FGI);
		cout &lt;&lt; &quot;Dealer busts. You win!&quot; &lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You get back your bet of &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FYI);
		cout&lt;&lt; &quot;$&quot; &lt;&lt; bet&lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FGI);
		cout&lt;&lt; &quot; + $&quot; &lt;&lt; bet&lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; in winnings!&quot; &lt;&lt; endl &lt;&lt;endl;
		cash+=bet*2;
	}
	else if ((dealer_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() &gt; dealer_hand.calc_hand_value())) {
		SetConsoleTextAttribute (hOut, BNULL | FGI);  //no one busts, check if player is higher
		cout &lt;&lt; &quot;You beat the dealer!&quot;  &lt;&lt;flush;
		SetConsoleTextAttribute (hOut, BNULL | FW);
		cout &lt;&lt; &quot; You get back your bet of &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FYI);
		cout&lt;&lt;  &quot;$&quot; &lt;&lt; bet&lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FGI);
		cout&lt;&lt; &quot; + $&quot; &lt;&lt; bet&lt;&lt;  flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; in winnings!&quot; &lt;&lt; endl &lt;&lt;endl;
		cash+=bet*2;
	}
	else if ((dealer_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() &lt; dealer_hand.calc_hand_value())) {
		SetConsoleTextAttribute (hOut, BNULL | FRI); //no one busts, check if dealer is higher
		cout &lt;&lt; &quot;Dealer wins!&quot; &lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You lost your bet of &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FRI);
		cout&lt;&lt; &quot;-- $&quot; &lt;&lt; bet&lt;&lt; &quot; -- &quot; &lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; endl &lt;&lt;endl;
			}
	else if ((dealer_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() &lt;= 21) &amp;&amp; (player_hand.calc_hand_value() == dealer_hand.calc_hand_value())) {
		SetConsoleTextAttribute (hOut, BNULL | FWI); cout &lt;&lt; &quot;Push.&quot;  &lt;&lt;flush; SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot; You get back your bet of &quot;;			//check for non-bust tie
		SetConsoleTextAttribute(hOut, BNULL | FYI);
		cout&lt;&lt; &quot;$&quot; &lt;&lt; bet&lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; endl &lt;&lt;endl;
		cash+=bet;
	}

}

void bet_status(double bet, double cash) {		//display bet and cash info
	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

		cout &lt;&lt; &quot;You have &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FGI); cout &lt;&lt;&quot;$&quot; &lt;&lt; cash &lt;&lt; flush;  SetConsoleTextAttribute(hOut, BNULL | FW);
			cout &lt;&lt;&quot;. Your current bet is &quot;;
			SetConsoleTextAttribute(hOut, BNULL | FMI);
			cout &lt;&lt; &quot;$&quot; &lt;&lt; bet &lt;&lt;&quot;.&quot;&lt;&lt;endl&lt;&lt;endl;
			SetConsoleTextAttribute(hOut, BNULL | FW);
}

void insurance(double bet, double &amp;cash, bool &amp;bought_ins) {	//insurance function

	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

	bought_ins=false;
	char input='?';
	if ((dealer_hand.hidden_hand_value()==11) &amp;&amp; (cash-bet/2 &gt;0.01))  //if ace is showing and player has enough money, offer insurance
	{
		SetConsoleTextAttribute(hOut, BNULL | FMI);
		cout &lt;&lt; &quot;Would you like to buy insurance? y/n --&gt; &quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cin&gt;&gt;input;
		while ( (!cin.good()) || ( (input!='y') &amp;&amp; (input!='Y') &amp;&amp; (input!='N') &amp;&amp; (input!='n') )) { //check input
			SetConsoleTextAttribute(hOut, BNULL | FMI);
			cout &lt;&lt; endl &lt;&lt; &quot;Do you want insurance or not? y/n --&gt; &quot;&lt;&lt;flush;
			SetConsoleTextAttribute(hOut, BNULL | FW);
			cin.clear(); cin.sync(); cin &gt;&gt; input;
		}

		if ( ((input=='Y')||(input=='y')) &amp;&amp; (dealer_hand.calc_hand_value()==21))	//check if dealer has BJ and pay out if insurance bought
		{cash+=bet; bought_ins=true; }
		if ( ((input=='Y')||(input=='y')) &amp;&amp; (dealer_hand.calc_hand_value()!=21))	//if not dealer BJ, lose insurance if bought
		{cash-=bet/2;bought_ins=true; }

	clear_screen();
	bet_status(bet, cash);
	dealer_hand.print_hidden_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;The dealer has &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FYI);
	cout &lt;&lt; dealer_hand.hidden_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; showing.&quot;&lt;&lt; endl&lt;&lt;endl;

	player_hand.print_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;You have &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; player_hand.calc_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;

		if ( ((input=='Y')||(input=='y')) &amp;&amp; (dealer_hand.calc_hand_value()==21))
		{cout &lt;&lt; &quot;Your insurance paid off!&quot;&lt;&lt;endl;}
		if ( ((input=='Y')||(input=='y')) &amp;&amp; (dealer_hand.calc_hand_value()!=21))
		{cout &lt;&lt; &quot;You lost your insurance!&quot;&lt;&lt;endl;}

	}
}

void print_intro (){		//intro and explain rules
	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

	cout &lt;&lt; &quot;Welcome to &quot;;
	SetConsoleTextAttribute(hOut, BW | FNULL);
	cout &lt;&lt;&quot;Black&quot; &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BW | FRI);
	cout &lt;&lt;&quot;Jack&quot; &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;!&quot; &lt;&lt; endl &lt;&lt; endl;
	cout &lt;&lt; &quot;At the beginning of each turn, enter your bet or press zero (0) to quit.&quot; &lt;&lt;endl&lt;&lt;endl;
	cout &lt;&lt; &quot;Press &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; &quot;H&quot;&lt;&lt;flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; to hit, &quot; &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; &quot;S&quot;&lt;&lt;flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; to stay, or &quot;&lt;&lt;flush;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; &quot;D&quot;&lt;&lt;flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; to double down.&quot;&lt;&lt;endl&lt;&lt;endl;
	cout &lt;&lt; &quot;Sorry, I haven't included the option to split.&quot; &lt;&lt;endl&lt;&lt;endl;
	cout &lt;&lt; &quot;The deck consists of 52 shuffled cards.&quot; &lt;&lt;endl &lt;&lt;&quot;When the deck runs out, a new deck is shuffled and used.&quot;&lt;&lt;endl&lt;&lt;endl;
	cout &lt;&lt; &quot;The dealer stays on &quot; &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FBI);
	cout &lt;&lt; &quot;17 and above &quot;&lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;(including soft 17).&quot; &lt;&lt;endl &lt;&lt; endl;
	SetConsoleTextAttribute(hOut, BNULL | FMI);
	cout &lt;&lt; &quot;Press ENTER to start&quot; &lt;&lt;endl;
	SetConsoleTextAttribute(hOut, BNULL | FW);

	string trash;
	getline(cin, trash);
}

int main () {

	HANDLE hOut;
	hOut = GetStdHandle(STD_OUTPUT_HANDLE);

	bool bought_ins=false;	//bool for whether insurance is bought
	card deck[52];			//deck of 52 cards
	 double bet=0;		//player bet
	 double cash=1000;	//player cash, starts at 1000
	int dealt_cards=0;	//number of cards dealt, for checking when to shuffle new deck
	char input;			//input for player moves

	srand((unsigned)time(0));	//seed pseudo random generator

	print_intro();

	clear_screen();
	make_deck(deck);
	shuffle_deck(deck);

	make_bet(bet, cash);

	while (bet != 0) {		//bet 0 to quit, otherwise play

	dealer_hand.get_deal(deck, dealt_cards);
	player_hand.get_deal(deck, dealt_cards);

	clear_screen();
	bet_status(bet, cash);
	dealer_hand.print_hidden_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;The dealer has &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FYI);
	cout &lt;&lt; dealer_hand.hidden_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; showing.&quot;&lt;&lt; endl&lt;&lt;endl;

	player_hand.print_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;You have &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; player_hand.calc_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;

	insurance(bet, cash, bought_ins);	//check for and offer insurance as necessary

	do {

	if (dealer_hand.blackjack==true)	//if someone has blackjack, input is &quot;Stay&quot; since no moves are needed
		input='S';
	else if (player_hand.blackjack==true)
		input='S';
	else {

	if ((bet &lt;=cash)&amp;&amp; !(player_hand.hand_count&gt;2))		//only show double down if player has enough money
	cout &lt;&lt; &quot;Hit (H), Double Down (D), or Stay (S) --&gt; &quot;;
	else if ((bet &gt;cash) || (player_hand.hand_count&gt;2))
		cout &lt;&lt; &quot;Hit (H) or Stay (S) --&gt; &quot;;

	cin &gt;&gt; input;
	cout &lt;&lt;endl;

	if ( ((input == 'd') || (input == 'D')) &amp;&amp; (bet&gt;cash)){		//check for cash to double down
			cout &lt;&lt; &quot;You don't have enough cash to double down. Hit (H) or Stay (S) --&gt; &quot;; cin.clear(); cin.sync(); cin &gt;&gt; input;
				while ( (!cin.good()) || ( !(  (input == 's') || (input == 'S') || (input == 'h') || (input == 'H'))) || ((input == 'd') || (input == 'D')))	{	//check input
					if ((input == 'd') || (input == 'D'))
						{cout &lt;&lt; &quot;Dude, I told you...you don't have enough money.  Hit (H) or Stay (S) --&gt; &quot;;cin.clear(); cin.sync(); cin &gt;&gt; input;}
					else
					{cout &lt;&lt; &quot;Jeez, first you try to double down with no money...&quot;&lt;&lt;endl;
					cout &lt;&lt; &quot;Now you can't even input properly. Hit (H) or Stay (S) --&gt; &quot;; cin.clear(); cin.sync(); cin &gt;&gt; input;}}
	}
	else if ( ((input == 'd') || (input == 'D')) &amp;&amp; (player_hand.hand_count&gt;2)){  //only allow double down on first move
			cout &lt;&lt; &quot;You've already hit, so you can't double down now. Hit (H) or Stay (S) --&gt; &quot;; cin.clear(); cin.sync(); cin &gt;&gt; input;
				while ( (!cin.good()) || ( !(  (input == 's') || (input == 'S') || (input == 'h') || (input == 'H'))) || ((input == 'd') || (input == 'D')))	{
					if ((input == 'd') || (input == 'D'))	//check input
						{cout &lt;&lt; &quot;The moment has passed. Let it go.  Hit (H) or Stay (S) --&gt; &quot;;cin.clear(); cin.sync(); cin &gt;&gt; input;}
					else
					{cout &lt;&lt; &quot;Not only are you late doubling down...&quot;&lt;&lt;endl;
					cout &lt;&lt; &quot;But now you can't even input properly. Hit (H) or Stay (S) --&gt; &quot;; cin.clear(); cin.sync(); cin &gt;&gt; input;}}
	}
	else {
	while ( (!cin.good()) || ( !(  (input == 's') || (input == 'S') || (input == 'h') || (input == 'H') || (input == 'd') || (input == 'D')))) //check input
	{
		if (bet &lt;=cash)
		{cout &lt;&lt; &quot;Try again. Hit (H), Double Down (D), or Stay (S) --&gt; &quot;;cin.clear(); cin.sync(); cin &gt;&gt; input;}
		else if (bet &gt;cash)
		{cout &lt;&lt; &quot;Try again. Hit (H) or Stay (S) --&gt; &quot;; cin.clear(); cin.sync(); cin &gt;&gt; input;}}
	}}

	if ((input=='h')||(input=='H'))		//hit
	{player_hand.hit(deck, dealt_cards); cin.clear(); cin.sync();}

	if (((input=='D')||(input=='d')) &amp;&amp; (bet&lt;=cash)) //double down
	{player_hand.hit(deck, dealt_cards);
	cash-=bet;
	bet*=2;
	cin.clear(); cin.sync(); input='S';} //set to &quot;stay&quot; after double down to prevent other moves

	clear_screen();
	bet_status(bet, cash);

	dealer_hand.print_hidden_hand();		//I should have put all this display stuff in a function...it keeps repeating!
	cout &lt;&lt; endl&lt;&lt; &quot;The dealer has &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FYI);
	cout &lt;&lt; dealer_hand.hidden_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot; showing .&quot;&lt;&lt; endl&lt;&lt;endl;

	player_hand.print_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;You have &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; player_hand.calc_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;

	} while ((player_hand.calc_hand_value() &lt;21) &amp;&amp; ((input!='s') &amp;&amp; (input != 'S')));  //let player hit until &quot;stay&quot;

	while (dealer_hand.calc_hand_value() &lt;17) {		//dealer hits on less than 17

		clear_screen();
		SetConsoleTextAttribute(hOut, BWI | FBI);
		cout&lt;&lt;&quot;Dealer's turn...&quot;&lt;&lt;flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt;endl &lt;&lt;endl;
		dealer_hand.print_hand();
		cout &lt;&lt; endl&lt;&lt; &quot;The dealer has &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FYI);
		cout &lt;&lt; dealer_hand.calc_hand_value() &lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;

		player_hand.print_hand();
		cout &lt;&lt; endl&lt;&lt; &quot;You have &quot;;
		SetConsoleTextAttribute(hOut, BNULL | FCI);
		cout &lt;&lt; player_hand.calc_hand_value() &lt;&lt; flush;
		SetConsoleTextAttribute(hOut, BNULL | FW);
		cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;
		Sleep(800);				//pause so dealer cards don't fly out all at once
		dealer_hand.hit(deck, dealt_cards);

		}
	clear_screen();
	cout &lt;&lt;endl &lt;&lt;endl;
	dealer_hand.print_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;The dealer has &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FYI);
	cout &lt;&lt; dealer_hand.calc_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;
	player_hand.print_hand();
	cout &lt;&lt; endl&lt;&lt; &quot;You have &quot;;
	SetConsoleTextAttribute(hOut, BNULL | FCI);
	cout &lt;&lt; player_hand.calc_hand_value() &lt;&lt; flush;
	SetConsoleTextAttribute(hOut, BNULL | FW);
	cout &lt;&lt; &quot;.&quot;&lt;&lt; endl&lt;&lt;endl;

	win_lose(bet, cash, bought_ins);
	make_bet(bet, cash);
	}

	if (cash==0)
		cout &lt;&lt; &quot;Sorry that you lost all your money!!&quot;&lt;&lt;endl&lt;&lt;endl;		//GAMEOVER

	cout &lt;&lt; &quot;Press &lt;Enter&gt; to close.\n&quot;;
	string trash2;
	cin.clear(); cin.sync();
	getline(cin, trash2);

return 0;
}
</pre>
<p>Here&#8217;s all the windows color junk:</p>
<pre class="brush: cpp;">

#ifndef SHORTCOLOURS_H

#define SHORTCOLOURS_H&lt;/code&gt;

&lt;code&gt; &lt;/code&gt;

&lt;code&gt;#define FW FOREGROUND_RED | \

FOREGROUND_GREEN | \

FOREGROUND_BLUE

#define FR FOREGROUND_RED

#define FG FOREGROUND_GREEN

#define FB FOREGROUND_BLUE

#define FY FOREGROUND_RED | \

FOREGROUND_GREEN

#define FC FOREGROUND_GREEN | \

FOREGROUND_BLUE

#define FM FOREGROUND_BLUE | \

FOREGROUND_RED

#define FWI FOREGROUND_RED | \

FOREGROUND_GREEN | \

FOREGROUND_BLUE | \

FOREGROUND_INTENSITY

#define FRI FOREGROUND_RED | \

FOREGROUND_INTENSITY

#define FGI FOREGROUND_GREEN | \

FOREGROUND_INTENSITY

#define FBI FOREGROUND_BLUE | \

FOREGROUND_INTENSITY

#define FYI FOREGROUND_RED | \

FOREGROUND_GREEN | \

FOREGROUND_INTENSITY

#define FCI FOREGROUND_GREEN | \

FOREGROUND_BLUE | \

FOREGROUND_INTENSITY

#define FMI FOREGROUND_BLUE | \

FOREGROUND_RED | \

FOREGROUND_INTENSITY

#define FNULL 0&lt;/code&gt;

&lt;code&gt;#define BW BACKGROUND_RED | \

BACKGROUND_GREEN | \

BACKGROUND_BLUE

#define BR BACKGROUND_RED

#define BG BACKGROUND_GREEN

#define BB BACKGROUND_BLUE

#define BY BACKGROUND_RED | \

BACKGROUND_GREEN

#define BC BACKGROUND_GREEN | \

BACKGROUND_BLUE

#define BM BACKGROUND_BLUE | \

BACKGROUND_RED

#define BWI BACKGROUND_RED | \

BACKGROUND_GREEN | \

BACKGROUND_BLUE | \

BACKGROUND_INTENSITY

#define BRI BACKGROUND_RED | \

BACKGROUND_INTENSITY

#define BGI BACKGROUND_GREEN | \

BACKGROUND_INTENSITY

#define BBI BACKGROUND_BLUE | \

BACKGROUND_INTENSITY

#define BYI BACKGROUND_RED | \

BACKGROUND_GREEN | \

BACKGROUND_INTENSITY

#define BCI BACKGROUND_GREEN | \

BACKGROUND_BLUE | \

BACKGROUND_INTENSITY

#define BMI BACKGROUND_BLUE | \

BACKGROUND_RED | \

BACKGROUND_INTENSITY

#define BNULL 0

#endif</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/blackjack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grid Game: Latest C++ Opus</title>
		<link>http://www.flockofcats.com/sneaky/stuff/grid-game-latest-c-opus/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/grid-game-latest-c-opus/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:59:25 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=880</guid>
		<description><![CDATA[Here is my latest C++ masterpiece after the jump. Move your guy (U) to get the treasure (T) and avoid the monsters (Q and M). 
This is some seriously hi-tech shizzle.
(Oh and I stole the clear screen function from the interweb ^_^. I couldn&#8217;t come up with that on my own!)


#include &#60;iostream&#62;
#include &#60;windows.h&#62;
#include &#60;cstdlib&#62;
#include &#60;ctime&#62;
using [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my latest C++ masterpiece after the jump. Move your guy (U) to get the treasure (T) and avoid the monsters (Q and M). </p>
<p>This is some seriously hi-tech shizzle.</p>
<p>(Oh and I stole the clear screen function from the interweb ^_^. I couldn&#8217;t come up with that on my own!)<br />
<span id="more-880"></span><br />
<code><br />
#include &lt;iostream&gt;<br />
#include &lt;windows.h&gt;<br />
#include &lt;cstdlib&gt;<br />
#include &lt;ctime&gt;<br />
using namespace std;</p>
<p>#define HEIGHT 8<br />
#define WIDTH 8</p>
<p>struct coord {<br />
	int x;<br />
	int y;<br />
};</p>
<p>void clear_screen ( void )<br />
{<br />
  DWORD n;                         /* Number of characters written */<br />
  DWORD size;                      /* number of visible characters */<br />
  COORD coord = {0};               /* Top left screen position */<br />
  CONSOLE_SCREEN_BUFFER_INFO csbi;</p>
<p>  /* Get a handle to the console */<br />
  HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );</p>
<p>  GetConsoleScreenBufferInfo ( h, &#038;csbi );</p>
<p>  /* Find the number of characters to overwrite */<br />
  size = csbi.dwSize.X * csbi.dwSize.Y;</p>
<p>  /* Overwrite the screen buffer with whitespace */<br />
  FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &#038;n );<br />
  GetConsoleScreenBufferInfo ( h, &#038;csbi );<br />
  FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &#038;n );</p>
<p>  /* Reset the cursor to the top left position */<br />
  SetConsoleCursorPosition ( h, coord );<br />
}</p>
<p>void initialize_grid(char grid[][HEIGHT], coord u, coord t, coord q, coord m) {<br />
	for (int H=0; H<HEIGHT; H++)<br />
		for (int W=0; W<WIDTH; W++)<br />
			 grid[W][H]='-';<br />
  grid[u.x][u.y]='U';<br />
  grid[t.x][t.y]='T';<br />
  grid[q.x][q.y]='Q';<br />
  grid[m.x][m.y]='M';</p>
<p>}</p>
<p>void print_grid(char grid[][HEIGHT]) {<br />
	for (int H=0; H<HEIGHT; H++)<br />
	{<br />
		for (int W=0; W<WIDTH; W++)<br />
			 cout << grid[W][H];<br />
		cout << endl;<br />
	}</p>
<p>}</p>
<p>void check_input (char &#038;input) {</p>
<p>	switch (input) {<br />
		case 'd':<br />
			input='D';<br />
			break;<br />
		case 'u':<br />
			input='U';<br />
			break;<br />
		case 'l':<br />
			input='L';<br />
			break;<br />
		case 'r':<br />
			input='R';<br />
			break;<br />
		case 'q':<br />
			input='Q';<br />
			break;<br />
		case 'D':<br />
		case 'U':<br />
		case 'L':<br />
		case 'R':<br />
		case 'Q':<br />
			break;<br />
		default:<br />
					cout << "Invalid input. Try again. " <<endl;<br />
					cout <<"Press U, D, L, or R  (Up, Down, Left, or Right) or Q to quit." << endl;<br />
					cout << "Do loop input: ";<br />
					cin >> input;<br />
					check_input(input);<br />
					break;<br />
		}<br />
}</p>
<p>void move_q(char grid[][HEIGHT], coord&#038; q){<br />
	int random_integer1(0);<br />
	int random_integer2(0);<br />
	int lowest=-2, highest=2;<br />
	int range=(highest-lowest)+1;</p>
<p>		if (grid[q.x][q.y]=='M')<br />
			grid[q.x][q.y]='M';<br />
		else if (grid[q.x][q.y]=='U')<br />
			grid[q.x][q.y]='U';<br />
		else<br />
			grid[q.x][q.y]='-';<br />
	random_integer1 = lowest+int(range*rand()/(RAND_MAX + 1.0));<br />
	q.x=q.x+random_integer1;</p>
<p>	random_integer2 = lowest+int(range*rand()/(RAND_MAX + 1.0));<br />
	q.y=q.y+random_integer2;</p>
<p>	if ((q.x<=-1) || (q.x>=WIDTH) || (q.y<=-1) || (q.y>=HEIGHT))<br />
	{<br />
		q.x=q.x-random_integer1;<br />
		q.y=q.y-random_integer2;<br />
		grid[q.x][q.y]='Q';}<br />
	else<br />
		grid[q.x][q.y]='Q';</p>
<p>}</p>
<p>void move_m(char grid[][HEIGHT], coord&#038; m){<br />
	int random_integer3(0);<br />
	int random_integer4(0);<br />
	int lowest=-2, highest=2;<br />
	int range=(highest-lowest)+1;</p>
<p>		if (grid[m.x][m.y]=='Q')<br />
			grid[m.x][m.y]='Q';<br />
		else if (grid[m.x][m.y]=='U')<br />
			grid[m.x][m.y]='U';<br />
		else<br />
			grid[m.x][m.y]='-';<br />
	random_integer3 = lowest+int(range*rand()/(RAND_MAX + 1.0));<br />
	m.x=m.x+random_integer3;</p>
<p>	random_integer4 = lowest+int(range*rand()/(RAND_MAX + 1.0));<br />
	m.y=m.y+random_integer4;</p>
<p>	if ((m.x<=-1) || (m.x>=WIDTH) || (m.y<=-1) || (m.y>=HEIGHT))<br />
	{<br />
		m.x=m.x-random_integer3;<br />
		m.y=m.y-random_integer4;<br />
		grid[m.x][m.y]='M';}<br />
	else<br />
		grid[m.x][m.y]='M';</p>
<p>}</p>
<p>void move_right(char grid[][HEIGHT], coord&#038; u)<br />
{<br />
if (u.x != WIDTH-1)<br />
{<br />
	if (grid[u.x][u.y]=='Q')<br />
		grid[u.x][u.y]='Q';<br />
	else if (grid[u.x][u.y]=='M')<br />
		grid[u.x][u.y]='M';<br />
	else<br />
		grid[u.x][u.y]='-';</p>
<p>	grid[u.x+1][u.y]='U';<br />
	u.x++;<br />
	}</p>
<p>}</p>
<p>void move_left(char grid[][HEIGHT], coord&#038; u)<br />
{<br />
if (u.x != 0)<br />
{<br />
	grid[u.x][u.y]='-';<br />
	grid[u.x-1][u.y]='U';<br />
	u.x--;<br />
}<br />
}</p>
<p>void move_up(char grid[][HEIGHT], coord&#038; u)<br />
{<br />
if (u.y != 0)<br />
{<br />
	grid[u.x][u.y]='-';<br />
	grid[u.x][u.y-1]='U';<br />
	u.y--;<br />
}<br />
}</p>
<p>void move_down (char grid[][HEIGHT], coord&#038; u)<br />
{<br />
if (u.y != HEIGHT-1)<br />
{<br />
	grid[u.x][u.y]='-';<br />
	grid[u.x][u.y+1]='U';<br />
	u.y++;<br />
	}</p>
<p>}</p>
<p>void check_status(char grid[][HEIGHT], coord u, coord t, coord q, coord m, char&#038; input){<br />
	if ((u.x==q.x)&#038;&#038;(u.y==q.y))<br />
	{<br />
	clear_screen();<br />
	print_grid(grid);<br />
	cout << "The Q monster ate you. YOU LOSE!!"<<endl;;<br />
	input='Q';}<br />
	else if ((u.x==t.x)&#038;&#038;(u.y==t.y))<br />
	{<br />
	clear_screen();<br />
	print_grid(grid);<br />
	cout << "You got the treasure. YOU WIN!!"<<endl;;<br />
	input='Q';}<br />
	else if ((m.x==u.x)&#038;&#038;(m.y==u.y))<br />
	{<br />
	clear_screen();<br />
	print_grid(grid);<br />
	cout << "The M monster at you. YOU LOSE!!"<<endl;;<br />
	input='Q';<br />
	}<br />
}</p>
<p>void your_move(char grid[][HEIGHT], coord u, coord t, coord q, coord m)<br />
{<br />
	   char input='m';<br />
	    clear_screen();<br />
		print_grid(grid);</p>
<p>		if (input != 'Q')<br />
			do<br />
			{<br />
				cout << "Press U, D, L, or R  (Up, Down, Left, or Right) or Q to quit: ";<br />
				cin >> input;<br />
				check_input(input);</p>
<p>				switch (input){<br />
					case 'R':<br />
						move_right(grid, u);<br />
						break;<br />
					case 'U':<br />
						move_up(grid, u);<br />
						break;<br />
					case 'L':<br />
						move_left(grid, u);<br />
						break;<br />
					case 'D':<br />
						move_down(grid, u);<br />
						break;<br />
				}<br />
				move_q(grid, q);<br />
				move_m(grid,m);<br />
				clear_screen();<br />
				print_grid(grid);<br />
				check_status(grid,u, t, q, m, input);</p>
<p>			} while (input != 'Q');<br />
}	</p>
<p>int main (){</p>
<p>	coord U={0,0};<br />
	coord T={WIDTH-1, HEIGHT-1};<br />
	coord Q={WIDTH/2, HEIGHT/2};<br />
	coord M={WIDTH/2+1, HEIGHT/2+1};<br />
	char grid[WIDTH][HEIGHT];</p>
<p>	initialize_grid(grid, U, T, Q, M);<br />
	print_grid(grid);</p>
<p>	your_move(grid, U, T, Q, M);</p>
<p>	return (0);<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/grid-game-latest-c-opus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deal cards</title>
		<link>http://www.flockofcats.com/sneaky/stuff/deal-cards/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/deal-cards/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 14:16:48 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=877</guid>
		<description><![CDATA[Here is some more C++, I am just posting it here to dump it somewhere to show it to someone with 1337 hacks. Please disregard if this sort of thing bores or confuses you. ^_^


#include &#60;iostream&#62;
#include &#60;string&#62;
#include &#60;cstdlib&#62;
#include &#60;ctime&#62;
using namespace std;
 
struct cards {
string face;
string suit;
int value;
bool dealt;
};
string face_choice[13] = {"A", "2", "3", "4", "5", [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some more C++, I am just posting it here to dump it somewhere to show it to someone with 1337 hacks. Please disregard if this sort of thing bores or confuses you. ^_^</p>
<p><span id="more-877"></span><br />
<code><br />
#include &lt;iostream&gt;<br />
#include &lt;string&gt;<br />
#include &lt;cstdlib&gt;<br />
#include &lt;ctime&gt;</code></p>
<p><code>using namespace std;</code></p>
<p><code> </code></p>
<p><code>struct cards {<br />
string face;<br />
string suit;<br />
int value;<br />
bool dealt;<br />
};</p>
<p>string face_choice[13] = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};<br />
int value_choice[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10};</p>
<p>cards deck[52];<br />
cards your_card[52];</p>
<p>void initial_deck()<br />
{<br />
int  n(0);</p>
<p>for (n=0; n&lt;52; n++)<br />
{<br />
deck[n].dealt=0;<br />
if ((n/13) == 0)<br />
{	deck[n].suit="Hearts";<br />
deck[n].face=face_choice[n];<br />
deck[n].value=value_choice[n];}</p>
<p>if ((n/13) == 1)<br />
{	deck[n].suit="Diamonds";<br />
deck[n].face=face_choice[n-13];<br />
deck[n].value=value_choice[n-13];<span style="background-color: #ffffff; ">}</span></p>
<p>if ((n/13) == 2)<br />
{	deck[n].suit="Clubs";<br />
deck[n].face=face_choice[n-26];<br />
deck[n].value=value_choice[n-26];}<br />
if ((n/13) == 3)<br />
{	deck[n].suit="Spades";<br />
deck[n].face=face_choice[n-39];<br />
deck[n].value=value_choice[n-39];}<br />
}<br />
}</p>
<p>void deal (int d_num)<br />
{<br />
int n (0);</p>
<p>srand((unsigned)time(0));<br />
int random_integer(0);<br />
int lowest=0, highest=51;<br />
int range=(highest-lowest)+1;</p>
<p>cout &lt;&lt; "Here are your card(s): " &lt;<br />
for ( n=0; n &lt; d_num; n++)<br />
{ random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));</p>
<p>if (deck[random_integer].dealt != 1)<br />
{your_card[n]=deck[random_integer];<br />
cout&lt;&lt; endl &lt;&lt; your_card[n].face &lt;&lt; " of " &lt;&lt;  your_card[n].suit &lt;&lt; " which is worth " &lt;&lt;  your_card[n].value;<br />
deck[random_integer].dealt=1;}</p>
<p><span style="background-color: #ffffff; ">} </span></p>
<p>}</p>
<p>int main ()<br />
{</p>
<p>int deal_number;</p>
<p>initial_deck();</p>
<p>cout &lt;&lt; "How many cards do you want? (0-52)" &lt;&lt; endl; cin &gt;&gt; deal_number;</p>
<p>if ((deal_number &gt; 52) || (deal_number &lt; 0)){<br />
cout &lt;&lt; "Sorry, there aren't that many cards in the deck!" &lt;&lt; endl;}<br />
else if (deal_number == 0)<br />
cout &lt;&lt; "That's cool, I didn't want to give you cards anyway!" &lt;&lt; endl;<br />
else<br />
deal(deal_number);</p>
<p>return 0;</p>
<p></code></p>
<p><code>}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/deal-cards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++</title>
		<link>http://www.flockofcats.com/sneaky/stuff/c/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/c/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 14:32:54 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=875</guid>
		<description><![CDATA[I have been playing around with C++  the last couple days, just because I am a big computer dork and to see what I can remember from back in high school computer science.
Here is my latest gem.

#include 
#include 
using namespace std;
float num1(0), num2 (0), answer (0);
string operate;
int main ()
{
cout ]]></description>
			<content:encoded><![CDATA[<p>I have been playing around with C++  the last couple days, just because I am a big computer dork and to see what I can remember from back in high school computer science.</p>
<p>Here is my latest gem.</p>
<p><code><br />
#include <iostream><br />
#include <string><br />
using namespace std;</p>
<p>float num1(0), num2 (0), answer (0);<br />
string operate;</p>
<p>int main ()<br />
{<br />
cout << "Welcome to the calculator" << endl;<br />
cout << "Enter the first number" << endl;<br />
cin >> num1;<br />
cout << endl << "Enter the second number." << endl;<br />
cin >> num2;<br />
cout << endl << "What operation would you like to perform? (+ - x /)" << endl;<br />
cin >> operate;</p>
<p>	if (operate == "x") {<br />
		answer=num1*num2;<br />
		cout << answer << endl << "You have multiplied " << num1 << " and " << num2 << ".";<br />
		}</p>
<p>	else if (operate == "+") {<br />
		answer=num1+num2;<br />
		cout << answer << endl << "You have added " << num1 << " and " << num2 << ".";<br />
		}<br />
	else if (operate == "-") {<br />
		answer=num1-num2;<br />
		cout << answer << endl << "You have subtracted " << num2 << " from " << num1 << ".";<br />
		}<br />
	else if (operate == "/") {<br />
		answer=num1/num2;<br />
		cout << answer << endl << "You have divided " << num2 << " into " << num1 << ".";<br />
		}</p>
<p>	else {<br />
		cout << "I'm sorry, you didn't enter a valid operation to perform" << endl;<br />
		}</p>
<p>}</code></p>
<p>Take that MS Calculator!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wave Test</title>
		<link>http://www.flockofcats.com/sneaky/stuff/wave-test/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/wave-test/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 16:05:06 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=854</guid>
		<description><![CDATA[After the jump, I have a Google wave embedded.





  var wave =
    new WavePanel('https://wave.google.com/wave/');
  wave.setUIConfig('white', 'black', 'Arial', '13px');
  wave.loadWave('googlewave.com!w+IqzNwpGpA');
  wave.init(document.getElementById('wave'));

]]></description>
			<content:encoded><![CDATA[<p>After the jump, I have a Google wave embedded.</p>
<p><span id="more-854"></span></p>
<div id="wave" style="width: 560px; height: 420px"></div>
<p><script
  type="text/javascript"
  src="http://wave-api.appspot.com/public/embed.js">
</script><br />
<script type="text/javascript">
  var wave =
    new WavePanel('https://wave.google.com/wave/');
  wave.setUIConfig('white', 'black', 'Arial', '13px');
  wave.loadWave('googlewave.com!w+IqzNwpGpA');
  wave.init(document.getElementById('wave'));
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/wave-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WH Health Bill</title>
		<link>http://www.flockofcats.com/yulzopolis/stuff/wh-health-bill/</link>
		<comments>http://www.flockofcats.com/yulzopolis/stuff/wh-health-bill/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 21:33:04 +0000</pubDate>
		<dc:creator>Yulzopolis</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=843</guid>
		<description><![CDATA[It looks like the White House might draft its own health care bill&#8230;.which I think could be a great strategy.  Congress has done 85% of the bill, and now Obama can take control of the debate, while also shielding himself from criticism by saying that he is taking the best parts from the various congressional [...]]]></description>
			<content:encoded><![CDATA[<p>It looks like the White House might <a href="http://www.cnn.com/2009/POLITICS/09/04/obama.health.care/index.html" target="_blank">draft its own health care bill</a>&#8230;.which I think could be a great strategy.  Congress has done 85% of the bill, and now Obama can take control of the debate, while also shielding himself from criticism by saying that he is taking the best parts from the various congressional plans that have already been drafted.  And anything to speed up the sausage-making process would be a good thing. (Damn you Gang of Six!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/yulzopolis/stuff/wh-health-bill/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Russian Translation</title>
		<link>http://www.flockofcats.com/yulzopolis/stuff/ninja-links-for-mile-high-russian/</link>
		<comments>http://www.flockofcats.com/yulzopolis/stuff/ninja-links-for-mile-high-russian/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 18:27:06 +0000</pubDate>
		<dc:creator>Yulzopolis</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=837</guid>
		<description><![CDATA[ In case anyone wants some great Russian and English translation services, you should check out our new company &#8211; Mile High Russian!  We&#8217;ll translate anything!   We also offer Russian tutoring!
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Mile High Russian" src="http://www.milehighrussian.com/eng/images/img03.gif" alt="" width="200" height="78" /> In case anyone wants some great <a title="Mile High Russian" href="http://www.milehighrussian.com" target="_blank">Russian and English translation services</a>, you should check out our new company &#8211; Mile High Russian!  We&#8217;ll translate anything!   We also offer <a href="http://www.milehighrussian.com/eng/otherservices.html" target="_blank">Russian tutoring</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/yulzopolis/stuff/ninja-links-for-mile-high-russian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ibaraki Local Brew &#8212; Hitachino Nest Beer!</title>
		<link>http://www.flockofcats.com/sneaky/stuff/ibaraki-local-brew-hitachino-nest-beer/</link>
		<comments>http://www.flockofcats.com/sneaky/stuff/ibaraki-local-brew-hitachino-nest-beer/#comments</comments>
		<pubDate>Tue, 05 May 2009 12:50:34 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[ibaraki]]></category>
		<category><![CDATA[Nest beer]]></category>
		<category><![CDATA[taste test]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=817</guid>
		<description><![CDATA[
Tonight, I am going to try several varieties of a locally brewed Ibaraki Beer &#8212; Hitachino Nest Beer.
I&#8217;ve tried one variety before; I don&#8217;t remember which I had, but I do remember it was good. So tonight, I bought three different types of Nest Beer (and one Hoegaarden) to do a little beer tasting.  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-818" title="beer" src="http://www.flockofcats.com/blog/wp-content/uploads/2009/05/beer.jpg" alt="beer" width="320" height="240" /></p>
<p>Tonight, I am going to try several varieties of a locally brewed Ibaraki Beer &#8212; <a href="http://kodawari.cc/engpage/kodawari/html/hitachino.htm">Hitachino Nest Beer</a>.</p>
<p>I&#8217;ve tried one variety before; I don&#8217;t remember which I had, but I do remember it was good. So tonight, I bought three different types of Nest Beer (and one Hoegaarden) to do a little beer tasting.  In addition to my rigorous scientific evaluation of the beers, an additional benefit is getting moderately tipsy while I play video games.</p>
<p>First up was the pale ale.  This one is good, but not really my favorite type of beer.  It reminds me a lot of Samuel Adams (although that is a lager&#8230;). I should say that it is malty with a good bit of hops, but the flavor of both this ale and that of Sam Adams reminds me of soap.  Yummy, beery, but nonetheless, soapy.  Am I the only one that gets that impression of Sam Adams (or Nest Pale Ale)?  My google search of &#8216;<a href="http://www.google.com/search?hl=en&amp;q=Sam+Adams+&quot;tastes+like+soap&quot;&amp;btnG=Search">Sam Adams &#8220;tastes like soap&#8221;</a>&#8216; does yield 130 hits, so maybe I&#8217;m not alone.</p>
<p>More updates to come as I work my way through the beers &#8212; expect my grammar and spelling to degenerate.</p>
<p><strong>Update #1: </strong>White Ale</p>
<p>I liked the Nest White Ale a lot.  It is lighter than the pale ale.  It had more of a wheaty, citrusy vibe to it &#8212; definitely more refreshing.  Nonetheless, it still had some weight to it, a bit of hoppiness and body.  All and all, I liked this one a lot.  White Ale &gt; Pale Ale.</p>
<p>And a tasting note &#8212; I&#8217;m drinking all these from frosted mugs that my old roommate pilfered from bars.  The fruits of his theivery are cold and delicious.</p>
<p><strong>Update #2: </strong>Weizen</p>
<p>This one is similar to the White Ale, but without the citrus overtones.  It is wheaty, with a soft, but distinct flavor of hops.  The website says that it has overtones of  &#8221; banana, clove, and vanilla&#8221;.  Not sure about the last two, but there is definitely a distinct note of banana.  Not quite as refreshing as the White Ale, but it is a little more firmer bodied.</p>
<p><strong>Update #3: </strong>Hoegaarden</p>
<p>This is very similar to the Nest Weizen.  Wheaty, slightly fruity or nutty (the chemist in me is looking at an aldehyde as the suspect!).  Also hints of yeast or a slight bready flavor.</p>
<p><strong>Conclusion: </strong>All around a very good crop of beers.  If you are ever in Ibaraki or if you find it in America, I recommend Nest Beer.  At least in Moriya, it can be found at Kasumi grocery stores.  Never seen it at a bar or izakaya, however.</p>
<p>The mainstream Japanese beers &#8212; Kirin, Asahi, and Sapporo &#8212; are all great, but they are also somewhat simple.  They are light, easy-to-drink, refreshing, but not complex brews.  They are comparable to a good domestic beer (I like MGD a lot more than Budweiser or Coors&#8230;), but a little better.  They lack the watered-down flavor that plagues many American beers.  But the Nest Beers offer rich, distinct flavors.  </p>
<p>All the beers I drank tonight were rather expenisve &#8212; 400 yen for an ~12 fl. oz. bottle.  This is about twice as much as domestic Japanese beers. (Incidentaly, Budweiser is criminally expensive for how terrible it is &#8212; about 300 yen ($3) per 12 fl. oz. can).  However, I felt these were all worth the extra cost.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/stuff/ibaraki-local-brew-hitachino-nest-beer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Work Stuff and My New Manbag</title>
		<link>http://www.flockofcats.com/sneaky/work/work-stuff-and-my-new-manbag/</link>
		<comments>http://www.flockofcats.com/sneaky/work/work-stuff-and-my-new-manbag/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 04:30:46 +0000</pubDate>
		<dc:creator>sneaky</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[commute]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[lasers]]></category>
		<category><![CDATA[manbag]]></category>

		<guid isPermaLink="false">http://www.flockofcats.com/?p=756</guid>
		<description><![CDATA[The new job seems to be going ok.  I still need to get the hang of some of the work, i.e., I need to edit a little faster and catch more of the mistakes the first pass through the paper, but hopefully I&#8217;m gradually improving.  On Friday, I did a pretty cool physics [...]]]></description>
			<content:encoded><![CDATA[<p>The new job seems to be going ok.  I still need to get the hang of some of the work, i.e., I need to edit a little faster and catch more of the mistakes the first pass through the paper, but hopefully I&#8217;m gradually improving.  On Friday, I did a pretty cool physics paper.  I can&#8217;t share the details because it is of course all confidential&#8230;but I will say there were lasers(!!).  One interesting thing about this job is that I will get to read about a lot of different topics.  </p>
<p>Yesterday, I bought a new <del datetime="2009-03-15T03:46:01+00:00">purse</del> manbag. On the train, I like to take various things to keep myself entertained &#8212; my ipod, my Nintendo DS, my cell phone, and a book.  But the book was a pain because it didn&#8217;t fit in my pocket, so I had to hold it.  And because of all the other stuff along with my keys and wallet, my pockets were bulging.  Hopefully with the manbag, I can keep my stuff little more organized and carry everything a little more comfortably, while looking only slightly womanly.</p>
<p>Also, for the commute, I need to get some better stuff on my ipod.  How can I have 20 GB of music and still think to myself &#8220;bleh, I can&#8217;t find anything to listen to!&#8221;.  Post music recommendations in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flockofcats.com/sneaky/work/work-stuff-and-my-new-manbag/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

