Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualShaquil

Posted 02 December 2012 - 09:50 AM

For example, the Tic Tac Toe game, I keep trying to do it the exact way that the other guy does it, and I get stuck, and constantly refer back to his code to see what I am doing wrong. Not to mention whenever I try doing it by myself, I constantly think about that persons code. So I can never try it myself.


What I learned, and I think everyone learns, organically just by going through the process of programming without any professors, is that to improve your ability to problem solve, you must be able to focus on specific problems without thinking about all the 600 other problems you'll have to solve before you're done. To do that, you need to plan out what you will program before you ever program. The first time I did that, it gave me a huge boost in productivity, and it was a lot easier to focus on specific problems rather than be distracted by the fact that I don't know what's next or why. If you sit and write it all out, you have your own notes to refer to, not anyone else's code.

It should be super high-level, too. Like:

Tic Tac Toe:
- UI:
- There will be a main menu, and you enter a number to choose an option:
--0 is Exit
--1 is New Game

etc, etc, etc.

Notice there that I'm not talking about any code. I'm just describing the game or program or whatever. You start with concepts, at the highest level possible, and then you work your way down. You do this because working from the highest to the lowest level of design means you decide that a certain thing is necessary before you decide how you implement it. Working from the bottom up would be the opposite: You'd be coding functions that do things, but you don't know why you need them to do that yet. That means later you're almost definitely going to change those functions.

Aside from that, I think you should quit on tic tac toe. Forget it. You're gonna keep looking at the other guy's code, and you're probably tired of it by now. Do something you only have a small idea how to implement. Are you familiar with dynamic arrays yet? Make a "Database" where users will specify the amount of entries they need to make, and then create a dynamic array of that size. It can be an array of objects that the user fills out the data members of, and then the user can delete, move or change things around in the database, which means you'll have to manage the memory, make new resized arrays, and play around with different C++ features. Don't worry about actually saving the data. But if you're interested, you could use fstream, or if you're on unix you could use I/O redirection, and that'd be something else to learn too. But the point is to just do stuff that takes thought and taxes your knowledge of the concepts of programming and the specific language you're using.

Other ideas: Hangman, a calculator with factorial, square roots and powers, rock paper scissors, a text adventure (if you like writing, too). A personality quiz? An IQ test? When I was first starting, I tried to come up with ideas for iPhone apps that I could implement little prototypes of in a console program, sort of like proofs of concept. This was great because I honestly believed in the idea, planning to actually make them real, usable applications, but I was also realistic about the current scope, limiting it to console programming and simple user input/output.

#1Shaquil

Posted 02 December 2012 - 08:27 AM

For example, the Tic Tac Toe game, I keep trying to do it the exact way that the other guy does it, and I get stuck, and constantly refer back to his code to see what I am doing wrong. Not to mention whenever I try doing it by myself, I constantly think about that persons code. So I can never try it myself.


What I learned, and I think everyone learns, organically just by going through the process of programming without any professors, is that you need to plan out what you will program before you ever program. The first time I did that, it gave me a huge boost in productivity, and it was a lot easier to focus on specific problems rather than be distracted by the fact that I don't know what's next or why. If you sit and write it all out, you have your own notes to refer to, not anyone else's code.

It should be super high-level, too. Like:

Tic Tac Toe:
- UI:
- There will be a main menu, and you enter a number to choose an option:
--0 is Exit
--1 is New Game

etc, etc, etc.

Notice there that I'm not talking about any code. I'm just describing the game or program or whatever. You start with concepts, at the highest level possible, and then you work your way down. You do this because working from the highest to the lowest level of design means you decide that a certain thing is necessary before you decide how you implement it. Working from the bottom up would be the opposite: You'd be coding functions that do things, but you don't know why you need them to do that yet. That means later you're almost definitely going to change those functions.

Aside from that, I think you should quit on tic tac toe. Forget it. You're gonna keep looking at the other guy's code, and you're probably tired of it by now. Do something you only have a small idea how to implement. Are you familiar with dynamic arrays yet? Make a "Database" where users will specify the amount of entries they need to make, and then create a dynamic array of that size. It can be an array of objects that the user fills out the data members of, and then the user can delete, move or change things around in the database, which means you'll have to manage the memory, make new resized arrays, and play around with different C++ features. Don't worry about actually saving the data. But if you're interested, you could use fstream, or if you're on unix you could use I/O redirection, and that'd be something else to learn too. But the point is to just do stuff that takes thought and taxes your knowledge of the concepts of programming and the specific language you're using.

Other ideas: Hangman, a calculator with factorial, square roots and powers, rock paper scissors, a text adventure (if you like writing, too). A personality quiz? An IQ test? When I was first starting, I tried to come up with ideas for iPhone apps that I could implement little prototypes of in a console program, sort of like proofs of concept. This was great because I honestly believed in the idea, planning to actually make them real, usable applications, but I was also realistic about the current scope, limiting it to console programming and simple user input/output.

PARTNERS