Decided to try out a new layout. So far I like the gist of it but I am not a fan of the right side as whole. I am going to have to look though the XML and see exactly what is going on. Sadly I don't know shit about XML so this could be a rather large problem. Luckily XML is something I am going to learn in school which means you get to learn it too! Here is hoping the learning part goes well.
- A. R. McGowan.
there is a world out there i know nothing about
Sunday, October 11, 2009
Friday, October 9, 2009
Next Monday
I start classes again. My Classes are as follows:
Advanced Programming: In this class we will take all the stuff we learned in C++ and apply it to C#. While I am glad to have put C++ under my belt there are a ton of annoyances I will not miss about it. Anyone who has ever attempted to perform a switch statement on a series of strings will know exactly what I mean. A man shouldn’t need 12 nested if statements to accomplish one goal unless that goal is to write ugly, hard to follow code.
College Writing I: This is basically English 101. You will most likely not see anything from this class posted on this blog. Hell I don’t even know why I am posting about it here.
Operating Systems: This class is on code portability, I think.
Software Development Life Cycle: I have no clue at all what this class about.
- A. R. McGowan.
next monday is not today
Advanced Programming: In this class we will take all the stuff we learned in C++ and apply it to C#. While I am glad to have put C++ under my belt there are a ton of annoyances I will not miss about it. Anyone who has ever attempted to perform a switch statement on a series of strings will know exactly what I mean. A man shouldn’t need 12 nested if statements to accomplish one goal unless that goal is to write ugly, hard to follow code.
College Writing I: This is basically English 101. You will most likely not see anything from this class posted on this blog. Hell I don’t even know why I am posting about it here.
Operating Systems: This class is on code portability, I think.
Software Development Life Cycle: I have no clue at all what this class about.
- A. R. McGowan.
next monday is not today
Labels:
c#,
class,
compatibility
Tuesday, October 6, 2009
A Code Snippet From Hangman
I was originally going to post the entire code for my Hangman project but in retrospect it seemed like a bad idea. The code is long as all hell and spread across eleven files. Some people who have downloaded the Hangman game can't get it to run and that is my fault. I code in the Vista environment and do not understand how to code for older versions of Windows such as XP or 98. I am however taking a class on operating systems this term so if all things go well I will be able to make programs for everyone to enjoy and not just for those on vista. One would think the Operating System wouldn't work to terribly against my since I didn't use any compiler specific functions nor did I use any System libraries.
Now that you have heard my excuse here is the function I used to check if the user was correct or not. String manipulation is a powerful but hard to follow thing. To understand the code you need to know what the variables are currently storing.
currentProgress looks something like this "*a*a*a*".
currentWord looks something like this "bananas".
and guessedWord is a single character that the user entered that was passed to the function using guessWord(userinput)
learn the code, don't steal it
Now that you have heard my excuse here is the function I used to check if the user was correct or not. String manipulation is a powerful but hard to follow thing. To understand the code you need to know what the variables are currently storing.
currentProgress looks something like this "*a*a*a*".
currentWord looks something like this "bananas".
and guessedWord is a single character that the user entered that was passed to the function using guessWord(userinput)
// This function checks for every occurance of the guessed character. Returns true if char
// is found even once. returns false if it isn't. This also update current progress and sets the
// stars to the letter they should be if that letter is the guessedWord.
bool hmGame::guessWord(char guessedWord) {
size_t found;
found = gameDict.currentWord.find(guessedWord) ;
if(found!=string::npos){
while(found!=string::npos){
gameDict.currentProgress.replace(found,1,1,guessedWord) ;
found = gameDict.currentWord.find(guessedWord,found+1) ;
}
return true ;
} else {
cout << "Incorrect Guess !" << endl << endl ;
return false ;
}
}
- A. R. McGowan.
learn the code, don't steal it
Labels:
c++,
code,
compatibility,
example,
hangman,
snippet,
syntax highlighting
Monday, October 5, 2009
It’s over.
My third term has come to an end. My final project was a hangman game. I have uploaded it in .Zip and .RAR format for anyone who wants to play it. I will gladly post the source code once I get a grade back on it (don’t want less honest people doing bad things). It was an interesting experience trying to make a whole game by myself but it was a fun one. There really is no substitute for trial and error when it comes to coding. No matter how much you read it just can’t compare to sitting down and trying code on your own.
Next term I will be starting C# so I changed the header. Here is hoping it’s as infuriating as C++!
Enjoy the game.
Hangman 1.0 by Austin McGowan .ZIP Format.
Hangman 1.0 by Austin McGowan .RAR Format.
- A. R. McGowan.
this game is racist
Next term I will be starting C# so I changed the header. Here is hoping it’s as infuriating as C++!
Enjoy the game.
Hangman 1.0 by Austin McGowan .ZIP Format.
Hangman 1.0 by Austin McGowan .RAR Format.
- A. R. McGowan.
this game is racist
Friday, October 2, 2009
Oops
I am kind of embarrassed to talk about this but I feel that if I don’t then this little blog will die out before it has even started to blossom. Every programmer makes mistakes and that is why we have syntax highlighting and fast compilers. Not every little bug is going to be caught until the product is released because no matter how smart a programmer is the user is dumber. Sometimes a programmer makes a big mistake that makes him feel like a complete moron. Be it a syntax error as small a missing semicolon or one as large as completely breaking their file structure. Other programmers have done this too, right?
For those of you not familiar with C++ let me set this out. C++ is also called C With Classes mainly because it is, in all regards, C with classes. Anything you can do in C you can do in C++ with the option of using classes. This isn’t the same situation with C# which I will be learning soon I am told.
So in C++ you are suppose to separate the declaration of your classes from the actually implementation of said classes. What this basically means is you are suppose to have a file call a header that contains what is akin to a warning.
Yo! C++, we are about to have a class called Menu.
Basically. Kind of. Not Really.
Ok in another file you have the actual class functions of the class. These are usually much longer. They are longer because they are the meat and potatoes of the the whole thing. The big problem comes with the fact that sometimes you REALLY need to have part of the class compile more then once but you can almost never let another part of the class compile twice. My bad.
Just recently I failed to do this correctly. I put the header stuff where the body should have been and vice versa. Want to know what happens? LOTS of errors. Also, the virtual function table explodes. Which is sad.
- A. R. McGowan.
R.I.P. Virtual Function Tables
For those of you not familiar with C++ let me set this out. C++ is also called C With Classes mainly because it is, in all regards, C with classes. Anything you can do in C you can do in C++ with the option of using classes. This isn’t the same situation with C# which I will be learning soon I am told.
So in C++ you are suppose to separate the declaration of your classes from the actually implementation of said classes. What this basically means is you are suppose to have a file call a header that contains what is akin to a warning.
Yo! C++, we are about to have a class called Menu.
Basically. Kind of. Not Really.
Ok in another file you have the actual class functions of the class. These are usually much longer. They are longer because they are the meat and potatoes of the the whole thing. The big problem comes with the fact that sometimes you REALLY need to have part of the class compile more then once but you can almost never let another part of the class compile twice. My bad.
Just recently I failed to do this correctly. I put the header stuff where the body should have been and vice versa. Want to know what happens? LOTS of errors. Also, the virtual function table explodes. Which is sad.
- A. R. McGowan.
R.I.P. Virtual Function Tables
Wednesday, September 30, 2009
Welcome
I am nearing the third term of my computer science classes at my online college. Recently I have had problems focusing so I have set out to design a way to keep myself on track. This blog is going to be a record of me attempting to finish my college (3 years). Hopefully you, the internet, will be able to help me focus and achieve my dreams. What you get in return is what I hope is decent writing.
Think of this a Julie and Julia but with C++ instead of sea bass.
Think of this a Julie and Julia but with C++ instead of sea bass.