Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

105 Neutral

About JeremyYox

  • Rank
  1. MGS5's trailer gives me nerdchub.
  2. JeremyYox

    (C#) Small question about calling variables

    So you're saying that by using the first method, each concatenation references a new memory block, while the second points to the same reference and thereby the same block? Is that how its more memory friendly? Is there a name for this technique? Thank you for the responses.
  3. JeremyYox

    C# For Starters

    I haven't had any issues studying 3.0 books. Just keep in mind the IDE has changed a lot and some of the locations they may mention for shortcuts or information may be out of date. The language is largely the same in my limited experience with only minor differences in the way some things are called up, most of which the IDE corrects for you, or catches for you. I use the book linked by elodman (C# 3.0 for absolute beginners) as well as more recent references ( ( and books almost side by side. I have a picky mind when picking up some concepts and there isn't really a reason to limit yourself to a single reference. There are plenty of free resources if money is an issue. Hopefully someone else with more insight can provide what may have changed, but as I said, I'm having no issues and anything outdated will fairly blatantly be pointed out by the IDE for you to come ask for clarification on.
  4. So, every example that I've seen until now when calling variables has been similar to say: Console.WriteLine("Hi there, " + userName + "!"); But today I came across someone using something like: Console.WriteLine("Hi there, {0}", userName); I was just wondering if there were any real differences in application or if its essentially two ways of accomplishing the same thing? I haven't seen any other examples of the latter, so it interested me. Thank you.
  5. JeremyYox

    The new guy says Hello!

    Welcome to the club, I'm new myself, currently struggling to learn C++ (I say struggling because its a frustrating battle of forgetting just as quickly as I learn!). Its fun and challenging so far. I'm probably the least qualified person to give advice on what to do, but I'd recommend that if you're already comfortable with C++ to stick with it and learn the finer details by applying them toward small projects in game design. Everyone says C# is easier to pick up as a first language, and so far as they've stated C++ is giving me no end of trouble (Only working it as my future classes teach it and its more an attempt to familiarize with it than anything). The reason as I understand it that C# is recommended to newcomers is because it is easier to grasp the concepts and the FAQ assumes no prior knowledge of C++ and accounts for its difficult learning curve, which you may already have overcome. Again, I'm new myself so don't commit based on anything you hear me say - but in the end I've seen that both languages have a lot of similarities and whichever you choose can get your foot firmly in the door.
  6. These are resources that were useful to an absolute beginner (namely me): Keep in mind when using these references that I'm no expert, and cannot vouch for just how qualified any of these references are at teaching/coding. Books: Beginning C++ Through Game Programming, 3rd Ed. (Dawson, Michael) -Great book, simple and interesting to follow. Details on some topics can be a bit less than desired and gives no real indication of what is for study and what is for informational purposes only. All issues with the book can be covered with the helpful community on GameDev beginner forums and a bit of brain work. Videos: The New Boston : The New Boston has tons of video tutorials for all sorts of topics from math to programming to...survival skills? Bucky is easy to follow and understand, and the layout of the tutorials is (so far) fairly smooth. AntiRTFM's Noob Spoonfeed Tutorials : A very laid back and detailed tutorial series on YouTube. AntiRTFM has a bit of an accent (not enough to impede understanding by any means) and talks slowly and softly which almost lulls me to sleep, but his tutorials literally spoonfeed the details to you in as close to laymen's terms as possible. Websites: - Forums are second to none in terms of friendly community willing to answer your questions so long as you put forth the effort to attempt to progress on your own as well. - Great site with tons of information. A lot of the documentation and definitions are too technical for me to understand at this point, but the forums, source codes, and community are all a great resource.
  7. JeremyYox

    Hangman program question (C++)

    I appreciate it. These forums seem have been a great help.
  8. So, I'm already back with my question of the hour. I've just finished looking over the hangman program from my book, and while the majority of it makes sense, there are two parts I don't seem to get. // Hangman // The classic game of hangman #include <iostream> #include <string> #include <vector> #include <algorithm> #include <ctime> #include <cctype> using namespace std; int main() { //setup const int MAX_WRONG = 8; //maximum number of incorrect guesses allowed vector<string> words; //collection of possible words to guess words.push_back("GUESS"); words.push_back("HANGMAN"); words.push_back("DIFFICULT"); srand(static_cast<unsigned int>(time(0))); random_shuffle(words.begin(), words.end()); const string THE_WORD = words[0]; //word to guess int wrong = 0; //number of incorrect guesses string soFar(THE_WORD.size(), '-'); //word guessed so far string used = ""; //letters already guessed cout << "Welcome to Hangman. Good luck!\n"; //main loop while ((wrong < MAX_WRONG) && (soFar != THE_WORD)) { cout << "\n\nYou have " << (MAX_WRONG - wrong); cout << " incorrect guesses left.\n"; cout << "\nYou've used the following letters:\n" << used << endl; cout << "\nSo far, the word is:\n" << soFar << endl; char guess; cout << "\n\nEnter your guess: "; cin >> guess; guess = toupper(guess); //make uppercase since secret word is in uppercase while (used.find(guess) != string::npos) { cout << "\nYou've already guessed " << guess << endl; cout << "Enter your guess: "; cin >> guess; guess = toupper(guess); } used += guess; if (THE_WORD.find(guess) != string::npos) { cout << "That's right! " << guess << " is in the word.\n"; //update soFar to include newly guessed letter for (unsigned int i = 0; i < THE_WORD.length(); ++i) { if (THE_WORD == guess) { soFar = guess; } } } else { cout << "Sorry, " << guess << " isn't in the word.\n"; ++wrong; } } //shut down if (wrong == MAX_WRONG) { cout << "\nYou've been hanged!"; } else { cout << "\nYou guessed it!"; } cout << "\nThe word was " << THE_WORD << endl; return 0; } How does the program replace the secret word's characters as they are guessed, and how does it search for those characters in the word? I think I can make out where it does it, but the process isn't making sense to me. I can see it compare guesses to the word, see that it tells how they're there or not and update MAX_WRONG, but the replacement/update/completion I can't make out. I appreciate the help and sorry for posting a new thread seemingly on the hour. Edit: Actually think I may be starting to make some progress on it. May be able to solo this one after all. I was originally misunderstanding , but what I am thinking now is: for (unsigned int i = 0; i < THE_WORD.length(); ++i) { if (THE_WORD == guess) { soFar = guess; } is incremented to check position by position through the length of THE_WORD for the value of guess, if its there, it updates the same position in soFar, which simply mimics the length of THE_WORD with '-' instead of the position's real value. The value for that position is updated with the value of guess in all positions it applies to. Woo, I think I got it. Sorry again for posting so much.
  9. JeremyYox

    Help understanding objects? (C++)

    +1. @The OP: It's probably not so much 'understanding objects' that's the problem here, but rather just becoming familiar with the idiosyncrasies of C++. The fact that you can push a string literal into a vector of std::string has to do with single-argument conversion constructors (as described above), and definitely isn't the kind of thing one would be expected to understand, necessarily, if one were just getting started with C++ and/or programming in general. So yeah, don't get too hung up on the idea of 'understanding objects'; just forge ahead, and things will gradually start to make more sense. [/quote] I appreciate the feedback, I started the first chapter of Accelerated C++ and the number of times they mentioned "just know what it is for now, not how it works" convinced me that my biggest problem at the moment is me in regards to learning. I'm going to keep going through my Beginning Game Programming book, try my best to let some things pass, and pull as much info from it as I can. I can always read it again if need be, right? Anyway, thanks to everyone for your responses - I'm really enjoying learning the language despite the frustrations I've come across.
  10. JeremyYox

    Help understanding objects? (C++)

    Ahh, I actually have this one. I started with "Getting started with game programming" because of the more casual approach but now it seems it doesn't have enough detail for me. Being only four chapters in, I can make the switch fairly easily. I appreciate the recommendation - back to the basics I go.
  11. JeremyYox

    Help understanding objects? (C++)

    "sword", "shield" and "armor" as they appear in the code are string literals[/quote] I was with you that far, but pretty much everything after that went miles over my head. I'm getting the feeling I'm in no position to start worrying over objects by the responses I'm getting. I'll keep to my studies and come back better equipped to tackle this hopefully. Edit: Actually, I can make bits and pieces of sense from what you're saying, but its so clouded with misunderstanding on my part that its hard to tell just what to make of it. Again, I think its just a lack of understanding of base concepts and I need to study more.
  12. JeremyYox

    Help understanding objects? (C++)

    Thanks NEXUSKill, I'll definitely look that up. At this point though I think I'd be better off actually finishing an introductory book before branching off trying to tackle a particular part of a whole in depth. I just have a habit of trying to know every detail of what is presented prior to moving on, it eats at me otherwise. I appreciate the advice.
  13. JeremyYox

    Help understanding objects? (C++)

    Sigh, thanks frob. I'm just going to keep reading and hope better understanding comes from it. I'm probably just looking too far ahead. I want to understand what you're saying but it just opens a million more questions - for now I'll just keep at it. I honestly don't know why the author wants me to keep things in mind he hasn't covered yet to begin with. You did, however, make it seem like less of a monster - so thats a plus.
  14. So today I'm trying to wrap my mind around what makes an object. I think I've got a marginal grasp on what an object is and really just want to make it concrete. The following is a snippet from the current example in my book. I've browsed through a handful of different explanations from various guides and tutorials and some have helped more than others - but what I got is an object is basically an (using my limited terminology to explain best I can) instance of a certain class that: a) has member data that it stores locally b) has member functions that can affect itself and other objects? vector<string> inventory; inventory.push_back("sword"); inventory.push_back("armor"); inventory.push_back("shield"); In the snippet, 'inventory' is a vector class object while 'sword', 'shield', and 'armor' are string type objects? I can only assume the string types as I honestly don't see how they differ from string literals aside from explicitly being called as a string type. I haven't worked with objects yet, but the author keeps pointing out to 'keep in mind the vector diagram is abstract because these are string objects and not literals'...and yeah, I'd never know the difference at this point. Am I getting warmer yet? Edit: would the string objects count as member data of inventory? eesh, my mind is hurting.
  15. Doopydoo, I think I hit my epiphany moments before you took the time to help, but I appreciate it nonetheless. If my assessment is wrong, please let me know and I'll grudgingly go back to trying to make heads or tails of it all.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!