Jump to content
  • Advertisement

Andrew.B

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

133 Neutral

About Andrew.B

  • Rank
    Newbie

Personal Information

  • Interests
    |programmer|
  1. Thank you very much sup3rn0va! Especially considering that you took the time to register to help me out. Much appreciated, I'll  take a look on the demo chapter and see what I can make out of it.
  2. Hmmm, I just read through the book a bit and I found this:   "The two sides of a condition operator have to be the same type. You can only compare ints to ints and doubles to doubles. Unfortunately, at this point you can’t compare Strings at all! There is a way to compare Strings, but we won’t get to it for a couple of chapters."   With today's C++ you can do these things without restriction - this means that this book has indeed some critical discrepancies with today's C++ compiler. In this case I was able to identify the issue, because I already learned and worked with operators and strings - but if I follow this book more down the road, it might lead me into thinking that some things are impossible/not yet implemented in c++ ...   On the other hand, I might use it, as you mentioned, as a programming method/approach book only and try to learn what is universal available in any programming language. I wrote this post so that it wouldn't mislead other newcomers that would start learning C++ using the above mentioned book.
  3. Thank you for the book recommendation you two! This last recommended book raised my interest thou, not that the first one wouldn't be helpful or useful - I'll be sure to check it later, but it didn't click as fast as this one did.   One questions thou - this book was written in 2012? (I found it on amazon that it was 2009), should this pose a problem, due to the fact that today c++ 2016 has changed in the mean time ? Or most of the principles still would stick ?
  4. Lactose, v1Xus, thank you for the reply! I enjoyed reading your comments - quite engaging and encouraging.   Hm, please forgive my second reply, I was very tired and didn't actually have the time or a rested mind to fully explain what I meant. I was a bit scared that this  topic might derail to "Let's help him improve his tic tac toe code". Also, by all means I am not afraid or irritated by critic (I hope it didn't look like that), hence I actually pasted the code to be seen by everyone, being aware that that is no piece of code-art. And Lactose, you are right - exactly this (discussing with others and sharing experiences) is one of the strongest methods to improve. Sill, as mentioned, I am interested to find other approaches of how to learn programming and how to apply them, rather than turn the topic into a very specific discussion revolving around my upper code. Here is an example of what I mean, and I've found on the internet:   "Every program that has ever been created can be reduced to three key phases: input, processing and output. Input comes from humans in some form or another. It may be mouse-clicks, key presses or data like numbers, names, etc. Without humans, there is no need for a computer, much less a computer program. Processing takes that human input and cooks it in some pre-determined way. Output is the result of processing and it is usually presented visually in some fashion." (http://www.kathekonta.com/rlguide/index.html)   I found that passage very insightful, and gave me a raw idea on how programming patterns should look like.
  5. Thank you for the question Brian - the code is there just to exemplify my (non) programming style. Sorry for being misleading, but I am currently not willing to discuss on how the code could be improved (I'm sure there are dozens of possible improvements!). You could just paste it in a c++ compiler if you wish to see what's it all about :lol:
  6. Hello gamedev! (the irony!)   Thank you for having on the forums and thank you for taking your time reading my first post!     Background   Get this: I hated math, did horribly in school and high-school and never got along with it. I always considered myself to be more of a humanist (if that's how it's called) - I loved studying other languages (self thought myself English and German of which I'm proud, they might not be native level, but I'm content), philosophy, learning history and ultimately I finished law in the university. At the end of the day I sort of started thinking that some humans are more math/precise science proficient, while others find themselves on the opposite spectrum (whatever that is). Shortly put: I have a very limited math knowledge.   Reason   Maybe it was because the constraint to learn was set aside, and my curiosity set in for something I didn't understand for a long time (as a side note I'm 25 years old). I thought programming can make me a bit more of a whole person, and reconcile with something I disliked, and so, slowly I gained more and more interest on this subject, on to the point where I started learning c++ by my own about one week ago. Before learning about arrays, I wrote this in c++:   [spoiler] #include "stdafx.h" #include <iostream> #include <string> #include <cstdlib> using namespace std; int main() {     /*     int mode;     cout << "Would you like to play with a friend, or against the computer?\n";     cout << "1. With a friend\n2. Against the computer\n";     cin >> mode;     system("CLS");     */     char plc1 = 255;     char plc2 = 255;     char plc3 = 255;     char plc4 = 255;     char plc5 = 255;     char plc6 = 255;     char plc7 = 255;     char plc9 = 255;     char plc8 = 255;     char plcTot = plc1 + plc2 + plc3 + plc4 + plc5 + plc6 + plc7 + plc8 + plc9;     while (true)     {         cout << endl << endl << endl << endl;         cout << "\t-------------------------\n";         for (int x = 0; x < 9; x++)         {             if (x == 3 || x == 6)             {                 cout << "\t-------------------------        ---------------------\n";             }             if (x == 1)             {                 cout << "\t|   " << plc1 << "   |   " << plc2 << "   |   " << plc3 << "   |          1   |   2   |   3" << endl;             }             else if (x == 4)             {                 cout << "\t|   " << plc4 << "   |   " << plc5 << "   |   " << plc6 << "   |          4   |   5   |   6" << endl;             }             else   if (x == 7)             {                 cout << "\t|   " << plc7 << "   |   " << plc8 << "   |   " << plc9 << "   |          7   |   8   |   9" << endl;             }             else                 cout << "\t|       |       |       |              |       |" << endl;         }         cout << "\t-------------------------\n";         if (plc1 + plc2 + plc3 == 237 || plc1 + plc4 + plc7 == 237 || plc3 + plc6 + plc9 == 237 || plc7 + plc8 + plc9 == 237 || plc3 + plc5 + plc7 == 237 || plc1 + plc5 + plc9 == 237 || plc4 + plc5 + plc6 == 237 || plc2 + plc5 + plc8 == 237)         {             cout << "O wins!\n";             break;         }                  if (plc1 != -1 && plc2 != -1 && plc3 != -1 && plc4 != -1 && plc5 != -1 && plc6 != -1 && plc7 != -1 && plc9 != -1 && plc8 != -1)         {             cout << "It's a draw!\n";             break;         }         int plaX;         int plaO;         cout << "\nX's turn: ";         cin >> plaX;         switch (plaX)         {         case 1:             plc1 = 88;             break;         case 2:             plc2 = 88;             break;         case 3:             plc3 = 88;             break;         case 4:             plc4 = 88;             break;         case 5:             plc5 = 88;             break;         case 6:             plc6 = 88;             break;         case 7:             plc7 = 88;             break;         case 8:             plc8 = 88;             break;         case 9:             plc9 = 88;             break;         }         system("CLS");         //////////////////////////////////////////////////////////////////////         cout << endl << endl << endl << endl;         cout << "\t-------------------------\n";         for (int x = 0; x < 9; x++)         {             if (x == 3 || x == 6)             {                 cout << "\t-------------------------        ---------------------\n";             }             if (x == 1)             {                 cout << "\t|   " << plc1 << "   |   " << plc2 << "   |   " << plc3 << "   |          1   |   2   |   3" << endl;             }             else if (x == 4)             {                 cout << "\t|   " << plc4 << "   |   " << plc5 << "   |   " << plc6 << "   |          4   |   5   |   6" << endl;             }             else   if (x == 7)             {                 cout << "\t|   " << plc7 << "   |   " << plc8 << "   |   " << plc9 << "   |          7   |   8   |   9" << endl;             }             else                 cout << "\t|       |       |       |              |       |" << endl;         }         cout << "\t-------------------------\n";         if (plc1 + plc2 + plc3 == 264 || plc1 + plc4 + plc7 == 264 || plc3 + plc6 + plc9 == 264 || plc7 + plc8 + plc9 == 264 || plc3 + plc5 + plc7 == 264 || plc1 + plc5 + plc9 == 264 || plc4 + plc5 + plc6 == 264 || plc2 + plc5 + plc8 == 264)         {             cout << "X wins!\n";             break;         }         //////////////////////////////////////////////////////////////////         //    if (mode == 1)         //{         cout << "\nO's turn: ";         cin >> plaO;         system("CLS");         switch (plaO)         {         case 1:             plc1 = 79;             break;         case 2:             plc2 = 79;             break;         case 3:             plc3 = 79;             break;         case 4:             plc4 = 79;             break;         case 5:             plc5 = 79;             break;         case 6:             plc6 = 79;             break;         case 7:             plc7 = 79;             break;         case 8:             plc8 = 79;             break;         case 9:             plc9 = 79;             break;         }         //    }         /*         else if (mode == 2)         {         if (plc9 = 88 )         plc5 = 79;         system("CLS");         }         */     }     cin.get();     cin.ignore();     return 0; } [/spoiler]       I know a lot of people advised against learning c++ as a first language, but this is exactly I'm searching for - a challenge in terms of self discipline for the mind, learning new concepts to play with and interact. As the title says, it's not the complexity that scares me, it's the fact that I feel I have a total false approach on how I'm thinking. This book that I'm reading (jumping into c++) is indeed teaching me how to code (syntax and all), but it doesn't teach how to become more structured or coherent in your code.   My objective and final question I want to program to keep in mental shape and to explore a totally new world for me, and in the same time have fun. I enjoyed writing the tic tac toe game. It was a revelation for me on how even a simple game can work. Personally I enjoy roguelike type of games very much (Dwarf fortress, rogue survivor, FTL, IVAN, Incursion, Liberal Crime Squad etc.) and I would look forward to develop some simple games like this to begin with - this being said, I don't fancy super graphics and all for practical purposes.   My question: How can I learn to be more concise in coding and to think more logical ? To properly implement whatever simple or complicated idea into code ? I'm the kind of person that believes in results by practice but the problem is I don't know what to practice. Sure I can continue coding and learning new "tools" that I can use, but I'm afraid I'm developing (or rather, I already have) a very messy method of approach. Would reading lecture on theory of coding help in this case ? Or maybe, going back, way back into the basics would help me understand the present better ? Like learning assembly code and how it works ? Or learning C ? I plan to take this learning process slowly, constant and systematic, so I do not feel like there is a rush - I want to enjoy the ride, even if there are no immediate results to experience. Again, thank you for your time reading this and I'm looking forward to read any post that lands on my topic!       Bonus question: [spoiler] Anyone who cares to join this discussion could also write at the end of his post, the answer to this question of which I am greatly interested: "Do you think we are divided between leftists and rightists thinkers? just as well as we are left handed or right handed?" [/spoiler]
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!