
Coding @ MindSay 
//author Justin Kingsley (kingslju@mmstate.edu) //don't just copy my code... it won't work with your program
//assignment 9
//Pig Latin
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
//*prototype
bool isVowel(char ch);
string rotate(string pStr);
string pigLatinString(string pStr);
string StringOrNot()
{
ifstream ins;
string con, //holds the information that comes form the input file
str, //place holder for the string about to be translated into pigLatin
cur, //currently translated string
input; //Place holder for the location of input file
char ch; //Place holder for current character
int call = 0; //tells the program if it needs to call the function pigLatinString if set to 1
cout << "Please Enter in the Location of the INPUT FILE:" << endl;
cin >> input;
ins.open(input.c_str());
if (ins.fail()) //Tests to see if input file is Readable
{
cerr << "Input file failed" << endl;
return "Input file failed";
}
ins.get(ch);
while (ins)
{
con = con + ch; //con collects confirmation string
switch(ch)
{
case '.' : case '!' : case ',' : case '?' : case ';' : case ':' : case '\n' : case ' ' : case '-' :
{
if(call == 1)
{
cur = cur + pigLatinString(str); // Runs PigLatin and add the returned string to cur
cur = cur + ch; // Adds char ch to cur
call = 0; // tells system str is empty
str = ""; // Clears str
ch = ins.get(); // gets next char value
}
else
{
cur = cur + ch; // Adds ch to cur
ins.get(ch); // gets next char value
}
break;
}
default:
{
str = str + ch; // Adds ch to end of str(soon to be processed by PigLatin
call = 1; // Tell system that str contains something
ins.get(ch); // gets next char value
}
}
}
ins.close();
cur = cur + "\n**********************\n** Is PigLatin for: ** \n**********************\n\n" + con;
return cur;
}
Thank god I dont relate to ALL of these yet..... Just most of them.....
| You Know You're Addicted to Coding When... |
Triple espresso's start tasting bland You have nightmares about COBOL and ADA. You have good dreams about multiple inheritance, factories, and compilers that support partial template specialization. Instead of using MS Word, you type your essay for school in HTML using NotePad. School? What's that? You can multiply a 32 bit binary number by a 6 digit hexadecimal number in your head. You laugh at movies that show programmers at work. You walk outside and wonder why the sun doesn't make a lens-flare in your eye.... You get withdrawal symptoms if you're away from a computer for more than 3 hours (Lines_of_Code) / (Hours_of_Sleep) < (Number_of_Energy_Drinks_Consumed) Every time you look at your clock, you see a power of 2 (6:40, 1:28, 2:56, 5:12, 10:24) You're pressing CTRL+S every 5 minutes, in every application.. You end each line you type with ";", even plain english ones; You code your own support software for the digital camera you just bought. When your significant other mentions having kids you lecture her on the disadvantages of multiple inheritance. MSVC opens on startup. Whenever somebody asks you to do something, you try to think of a way to write a program that would help you. You have 2 bookshelves filled with programming books in your room... because the 5 shelves in the living room are full. You know the following sequence by heart: 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 You read The Tao of Programming...and relate. You need an intercom for downstairs to tell your parents / girlfriend / wife / whatever to get you more JOLT. When you take a break from programming, and program. When you can say with a great level of confidance that you have written more lines of code than english. You wake up in the middle of the night with the solution to your coding problem. Your 4 year old son has seen you login and out of Windows and Linux so much that he can do it himself. You are the only one who knows what the difference is between a coder and a programmer. You have more groceries inside your keyboard than in your fridge. You have a toothbrush next to your monitor. You watch a tv sitcom and think "I could write an algorithm that writes the scripts for these things" You sit stuck at traffic lights and work out a more efficient algorithm for them, based on road orientation, sensor placement, time of year, time of day, weather and local sporting events, in your head. The people you respect most you have never physically seen or spoken to, but you always bow to their knowledge. Your family informs you than you should go and make some more friends ...so you start coding AI routines. You consider 'drinking caffeine' and 'sleeping' to be synonyms. You can write 'Pong' in any language for any OS (or even NO OS) in under 4 minutes. You get drunk\high\otherwise intoxicated just for a different coding experience. You think of sex as an algorithm. Sunshine genuinely hurts your eyes. You actually feel like crap from getting 8 hours of sleep, that just so unnatural You can't help but squeeze math and research topics in while sweet-talking to a girl. You have a "hacker's manicure" (i.e. huge calluses on all your fingers) When you die you want "Hello world" carved into your headstone. You keep old computers around and boot them up every once in awhile for the nostalgia. You would like to have an Aibo to see if you can run Linux on it. Your mother phoned you to see if you were still alive, and you responded "ping". You look at your old code and cringe. You got a D in Computer Programming class because you where coding a plasma effect instead of a "Hello World!" program. You read books on quantum physics and time-travel to relax. When someone asks you your favorite color, you give the RGB code in binary. No one else can ever use your computer, as it is tweaked so much only you know how to use it. The first time you use another person's computer it takes you less than 30 seconds to completely disable all useless programs from running at boot and uninstalling all the ad-ware the fools had on the system. You actually get these jokes and pass them on to other friends who are addicted to coding. |
I been doing much more Warhammer painting over the weeks, I finally started to like painting large quantities of similar looking models without getting bored after 20th one.
I been also felt a pull to come back to my programming projects, and I actually started something code-named Chaos Wars II, OooooOOo, it's gonna be fun when I finish it (if I finish it :D). It will be an online PHP game, a continuation on a project that has been semi closed for past 6 months. I'll maybe post a link sometime in future when I actually do something that will work. :)
What else, I stumbled on my old rival's website, well he is not an admin of the site but is one of the, staff of sorts. http://www.planetadnd.com is the place. General Xilton/Kryox being my arch rival :D I may actually start helping him with stuff. :O Wierd feeling.
Regards,
Albob
Over the last week, I've given a bit of thought to the website I have to create as a project for my IT class. My 'client', is one of my ex-teachers, Mr Hughes, and the site is going to be called Search Skills (its aim will be to help 6th graders search the internet, and I guess it'll be affiliated to Mr Hughes's Study Skills site)
Because the 'end users' are rather young, I tried to design a layout that wasn't too childish but which still had a 'fun' look to it. So I thought, rounded-edge and pastel colours would do the trick.
This is the final result, and I'm not exactly satisfied. I have half my mind to restart it all over again. It's too washed out and the coding is messy.
programming



