1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
// Pig Latin
// Hunter Griffin
// Based on Python file
// 7-26-11
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main ()
{
cout <<" .....~~~~~=,..... ...... .. "<< endl;
cout <<" ...:~~~~~~===.... . ......... " << endl;
cout <<" ......~~::~::~~==~.................... ... ......:~::~~~......." << endl;
cout <<" .....:~::~~=~~~==+=+....................... ...:~~~~~~~~==~....." << endl;
cout <<" ....~~~~~~====~===~::::::::~~~:~~~~:::~:.....~~~~~~~~~::~===...." << endl;
cout <<" ..,~~~~=========~:::::~~~~~~~~~~~~~~::~~~~~::~~~~~:~~~~~~~=+=..." << endl;
cout <<" ..~~====++++==:::~:~~~::~~:~~:~~~:~~~~~~~~~~~::::~~:~======+=~." << endl;
cout <<" ,~===++??=~::~:::~::~~:~~~~:~~::~~~~~~~~~~~~~~~~~~=======+=+++=:" << endl;
cout <<" ...:~~==++??=:::::~~:::::::~:~~~~~~~~~~~~~~~~~~~~~~~~~:~=++=+=++++==,..." << endl;
cout <<" ..~~==++???~~~~~:~~::::::::::~~:~~::~~:~~:~~~~~~~~~~~=~==++++++++++==,.." << endl;
cout <<" :~~===?+?+~~~:~~::~:::::::::~~~~~~~~~~~~~~:::~~~~~~=~=====+?+++=+??+==,." << endl;
cout <<"...=+===++I?+==~~~~~::::::::::::~:~~~~~~~~~~~~~::::~~~~=~=====++++??++???==+...." << endl;
cout <<"..++=++??III==~~~~~~=::::::::::~~~~~~~~~~=~~~~~~~:~~~~~~======+++++??++++++==. ." << endl;
cout <<"..,?I?III77?==~~~~::::::::NNN,:~~~~~~~~~~~~~~~==~~~~~~~~===+==++++??????+?+++=,." << endl;
cout <<".....I7III7$+==~~~~~~~:$,,~~::+~~~~~~~~==~~~~======~===~====+?=+++?IIII????I??I," << endl;
cout <<"...........,==~~~~~~~~~~~~~:~:~:~~~~~~=~====~=~===:$MM7,++===++++??I7II7III7I?,." << endl;
cout <<" ....=======~~~~~~~~~~~~~~~~~==~==========O,~=~=,M=++++++++??77777777?..." << endl;
cout <<" ...=~====~=~~===+=+===~======================+====++?+++?+???..........." << endl;
cout <<" ...========~~=+=D$ON~===~=========+=+=++=++++++++++++??+++?+=..........." << endl;
cout <<" ..============$N,,,::?~===============++?IIO7++++?++??++??+++,.. " << endl;
cout <<" ..=====~==~==+M.,,,,:M================++M8,::ON+++++?++??????+.. " << endl;
cout <<" .=====~+==~===$::,,,:M~==+=======+=+==I=N:::~:N7+++++?++++??++.. " << endl;
cout <<" ....~+===========~?,IMM.:Z:============++++M,~:~=~,M++++??I??????+. " << endl;
cout <<" ..,=++===========~7NNNDMMM:+=======+++++=?=N:,..,=.N+?++??????????:. " << endl;
cout <<"......+==============+MNN..NNM=~==+===++++=+++~D+MNMNM,M++????????????+..... " << endl;
cout <<" ....+==~==========~==,NNNMNN:~~========++==++~MNN$,NNM?++??+?????????+?.... " << endl;
cout <<"...,====~~~~====~==~~~:~~NN~=:~~=~==========++?+M:MMMNM~?+?+??+:?+???+++~... . " << endl;
cout <<"..:+==~~~~~~~~=~:~~~~:~:~::~::::~~~~~~==~=~==~~~D~~NMM~+~+~~??+~????~++~==.. " << endl;
cout <<"..===~~~~~~~~:~~~~~~~~:~:::~~~~::::~::~:~~::::~~::~~~=~=++?+???+????++====+. " << endl;
cout <<".++====~~~:~:~~~~~~~:::::::::~~~~~~~~~~~~~~~:~::::~~~~=~+++?+??++?+=+=+===== " << endl;
cout <<"+++=====~~~~~~~~~~~~::::::~:~:~~~~~~~~~~~~~=~~~~~~~~~~=~===++++++=======+=+==..." << endl;
cout <<"?++++===~~~~===~~~~~::::~~~~~:~~====~=~~~~~~~===~~~~~=======+++==========+=++?.." << endl;
cout <<"I?+++===?====+==~~~:~:~~:~::~~============~~~~==+========+=++++==========+++++.." << endl;
cout <<"I??++++++++++=====~~~~~~~:~~=========+===========+======+=+++?+=========+++?+?.." << endl;
cout <<"I?I??+++++??++====~~~~~~~===================+====++++==+=++++++++====+++?++??I.." << endl;
cout <<"I?I???????II?++===~=~~=~=====++++======++++=+=++++++++++++++?????+++?=??I????I.." << endl;
cout <<".II?????+++++=======+=~=======$7=+=++++88=+++==+=+?++++++++????I?++++I+????III.." << endl;
cout <<"..I????++++==~=++===+=========$7?+==++I$$~++=+===+=+??+?+????IIII??????+???I7:.." << endl;
cout <<"..?7?I??+?+===~=+============~7I+++==+OO7~++=++++++????+?+?IIIIII???????I??II..." << endl;
cout <<"...,7???++++++=~=++===========ZZ===+++=$?~+++=++++????????II?=?I7???I??????I~..." << endl;
cout <<".....?I???++++====+++======+=++==+=+++=~===++++++???????III?++?IIII7IIIIIIII...." << endl;
cout <<" .I?????++++==~~?++=+++=+=+=++++=+++++=+++++??????II7I??????IIIIIIIIIII. " << endl;
cout <<" ...?II+++++++==~=+???+++++++++++++++++?++????IIII$7????I???IIIII7I7III.. " << endl;
cout <<" ....?I???++++++==++?I?+?I???+++?+?++???????IIII8$?????????III7I7II7II... " << endl;
cout <<" ..II??++=+++=+++?III7$I???II?IIIII?I+I$Z$$$7??I??II7?III77II777,.... " << endl;
cout <<" ...+7????++++==++?IIII77$$$ZZ$$$Z$$Z$$ZZ$7I????II?IIIIIIIIII7...... " << endl;
cout <<" .II+??+++===+??I????77$7$ZOZZZZ$ZZ$$$I????IIIIIII7I?7$?. " << endl;
cout <<" ...I??+++=====++I=+=?I7777$$ZZ$$$$$7II???IIIIII7777$:... " << endl;
cout <<" .....I???+++===++?+=+????I777$II7?????I?IIII7I77II...... " << endl;
cout <<" ..II??++=++=+++++?????I$+?????I??III77I7$$~.... " << endl;
cout <<" ....=II??+===+++====+===+=++???IIII7777,....... " << endl;
cout <<" .......??+?++++==++++=+++??I?IIII77$........... " << endl;
cout <<" ...????????+????II?IIII7$:..... " << endl;
cout <<" .....??II???I??I7I7=.......... " << endl;
cout <<" .........,,:::,......... ..... " << endl;
string vowels = "aeiou";
string upvowels = "AEIOU";
string new_word;
string pig_message = "";
string play_again = "Y";
string message;
vector< string > Tokens;
while (play_again == "Y" || play_again == "y")
{
cout << "Input Word or phrase: ";
getline (cin, message);
void ParseString( const string& aLine, vector< string>& tokens )
{
string buffer;
stringstream ss( ALine);
while( ss >> buffer )
tokens.push_back( buffer );
for( int i = 0; i < vowels.length(); i++ )
{
if( message[ 0 ] == vowels[ i ] )
{
new_word = message + "ay ";
pig_message += new_word;
}
}
}
cout << new_word << endl;
cout << "Would you like to play again? (Y or N)";
getline (cin, play_again);
}
cout << "Omecay Againay! (Press Enter to exit)";
return 0;
}
|