need ideas
Moderator: Coders of Rage
-
- Chaos Rift Newbie
- Posts: 29
- Joined: Sat Oct 17, 2009 4:19 pm
need ideas
I need some new ideas for a program to try coding as a beginner in the c++ language, I ask this because I cant think of anything to code. I would like simple ideas because I am fairly new to programming with c++ and I have been having a hard time to try to code something that will test my abilities so far.
p.s. Thank you very much for any and all ideas they are greatly appreciated
p.s. Thank you very much for any and all ideas they are greatly appreciated
- Trask
- ES Beta Backer
- Posts: 738
- Joined: Wed Oct 29, 2008 8:17 pm
- Current Project: Building a 2D Engine
- Favorite Gaming Platforms: Sega Genesis and Xbox 360
- Programming Language of Choice: C/C++
- Location: Pittsburgh, PA
- Contact:
Re: need ideas
I recommend going through some tutorials, not sure how 'beginner' you really are, but I do know that learning some new feats of the language always gave me ideas of things to try as I would better understand or have an idea on how something was made to begin with.
Dear god, they actually ported ES to a piece of celery!MarauderIIC wrote:You know those people that are like "CHECK IT OUT I just made Linux run on this piece of celery [or other random object]!!"? Yeah, that's Falco, but with ES.
Martin Golding wrote: "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Pennywise
- Chaos Rift Cool Newbie
- Posts: 55
- Joined: Tue Sep 22, 2009 1:36 pm
- Favorite Gaming Platforms: Megadrive(Genesis), Dreamcast, SNES, Nintendo 64
- Programming Language of Choice: C, C++ and Java
- Location: England
Re: need ideas
A good one can be a program that asks for your age, and says whether your a child, adult or whatever using if and else statements (or switch statements).
-
- Chaos Rift Newbie
- Posts: 29
- Joined: Sat Oct 17, 2009 4:19 pm
Re: need ideas
Yea that is a good idea
I think I am going to try that :p
I think I am going to try that :p
Re: need ideas
Building off of Pennywise's idea:
Base your programs off of real life.
I currently don't have a compiler so don't hate me if there are errors.
Base your programs off of real life.
I currently don't have a compiler so don't hate me if there are errors.
Code: Select all
//This gives you good advice
#include <iostream>
using namespace std;
unsigned short int grade;
int main()
{
cout << "Enter your grade!";
cin >> grade;
//I don't like switch statements :p
if( grade > 100 )
cout << "Lying gets you nowhere";
else if( grade >= 90 && grade <= 100 )
cout << "You're better than me";
else if( grade >= 80 && grade < 90 )
cout << "What does the B stand for?";
else if( grade >= 70 && grade < 80 )
cout << "It means average, believe it or not";
else if( grade >= 60 && grade < 70 )
cout << "Remember, it's your teacher's fault.";
else if( grade >= 50 && grade < 60 )
cout << "It stands for fantastic. Srsly.";
else
cout << "Stop drinking on school nights.";
cin.get();
return 0;
}
I'm an altogether bad-natured Cupid.
Re: need ideas
You can also dive into game programming, write a "Guess the Number" game
Re: need ideas
A good tutorial regime for someone looking to be a games programmer might be something like:
Absolute beginner
Test your skills
AdvancedNote there is no intermediate
The OOP (object oriented programming) stuff is important to get right, as a lot of data-structures and programming paradigms are either dependant on OOP, or are typically expressed in OOP. Seeing as you are using C++ you will be needing to know about pointers. Pointers link in to OOP for things like linked-lists. Which is an abstract data-type. which brings me too...
Abstract Data Types/Data-Structures
I'm not going to say all the ones you should learn, because it depends on your goals. But this is where you are starting to lookup proven structures that people have made. There is alot to cover here, and it can be a bit dry so I don't reccommend tackling it on it's own. I suggest coupling it with some graphics/games programming. If you do that you might even find some examples of where these data-structures are used, such as with binary trees etc.
Graphics
By the time you are up to graphics you will be a pretty accomplished programmer, I would say learn about this at the same time as ADTs. Choose a graphics API, I reccommend OpenGL personally, look up about matrices calculations, translation, rotation, scaling, pushing and poping, as these are how the maths works behind the scenes (its actually important knowing whats going on behind the scenes with these particular things). Obviously you will also need to learn how to create an OpenGL window, etc. Which brings me to the point of Windows Programming, you don't need to learn how to program OS based code, actually it's very important you don't get caught up with it. I remember when I was getting into OpenGL I almost ended up learning windows programming because I tried to find out what ever obscure windows call did when setting up a window. There's alot of code and you really only need to know how a window handles messages.
Test your skills
Vectors! Very important... if you are smart enough to have gotten this far then you can probably make up alot of ways of going about solving problems like collision detection, etc. That said it helps to look up how other people do it, as there is no point in re-inventing the wheel and I assure you people have done things in better ways then you . You should look into singletons (this should probably happen after you have a solid understanding of OOP and pointers). Model View Controller is a must to learn if you plan on making any big projects. Don't be afraid to read up on these kinds of things during the Advanced Stage of learning as it puts into perspective alot of the usefullness of OOP. That said, you probably shouldn't attempt this kind of programming that early, just understand the concepts behind it to make OOP feel more useful.
Test your skills
By this time you are ready to dump your engine and use someone elses, look into the technologies behind things such as scripting. Realistically it's usually impractical to use your own engine unless you are making a simple project.
Advanced challenge if you want to get into 3d
Make a simple 3d model loader (MD2 is reccommended).
Expand your model loader to allow for keyframe animation.
Expert Games Maths
Expert Graphics
Expect to take years before you are truelly accomplished. If you have gotten to the stage where you are using someone elses game engine and have dumped your own then you are of about the average level of someone leaving uni that did a games degree I would think. The beginner topics wont take you nearly as long as the rest to explore which is good . A final word of advice, obviously don't get ahead of yourself this list is a listing for someone who would want to become a proffessional level games programmer. This list isn't comprehensive, it eludes to alot of the stuff you should start to learn and expects you to research what areas.
Absolute beginner
- Basic data types; int, bool, float, double, char
- Arrays and Strings.
- Input and Output.
- Selection.
- Iteration.
- Methods/Functions.
Test your skills
- Make a simple command console based game. Use letters/characters to represent the objects in the game. Try making it 'realtime'
AdvancedNote there is no intermediate
- Object-oriented programming (there is alot more to cover here).
- Pointers.
- Multi-threading.
The OOP (object oriented programming) stuff is important to get right, as a lot of data-structures and programming paradigms are either dependant on OOP, or are typically expressed in OOP. Seeing as you are using C++ you will be needing to know about pointers. Pointers link in to OOP for things like linked-lists. Which is an abstract data-type. which brings me too...
Abstract Data Types/Data-Structures
I'm not going to say all the ones you should learn, because it depends on your goals. But this is where you are starting to lookup proven structures that people have made. There is alot to cover here, and it can be a bit dry so I don't reccommend tackling it on it's own. I suggest coupling it with some graphics/games programming. If you do that you might even find some examples of where these data-structures are used, such as with binary trees etc.
Graphics
By the time you are up to graphics you will be a pretty accomplished programmer, I would say learn about this at the same time as ADTs. Choose a graphics API, I reccommend OpenGL personally, look up about matrices calculations, translation, rotation, scaling, pushing and poping, as these are how the maths works behind the scenes (its actually important knowing whats going on behind the scenes with these particular things). Obviously you will also need to learn how to create an OpenGL window, etc. Which brings me to the point of Windows Programming, you don't need to learn how to program OS based code, actually it's very important you don't get caught up with it. I remember when I was getting into OpenGL I almost ended up learning windows programming because I tried to find out what ever obscure windows call did when setting up a window. There's alot of code and you really only need to know how a window handles messages.
Test your skills
- Make a simple game. Something basic, like a simple asteroids game. Anything you do in openGL can be done in either 2d or 3d, I reccommend making 2d but in actuality you could just as easily make a simple 3d game if you have a good understanding of 3d.
Vectors! Very important... if you are smart enough to have gotten this far then you can probably make up alot of ways of going about solving problems like collision detection, etc. That said it helps to look up how other people do it, as there is no point in re-inventing the wheel and I assure you people have done things in better ways then you . You should look into singletons (this should probably happen after you have a solid understanding of OOP and pointers). Model View Controller is a must to learn if you plan on making any big projects. Don't be afraid to read up on these kinds of things during the Advanced Stage of learning as it puts into perspective alot of the usefullness of OOP. That said, you probably shouldn't attempt this kind of programming that early, just understand the concepts behind it to make OOP feel more useful.
Test your skills
- Make a game engine and remake your simple game within the engine or a similar simple game. DONT get caught up in this, you will likely dump the engine afterwards, this is just so that you understand how these differen't paradigms work and how a big project could be put together.
By this time you are ready to dump your engine and use someone elses, look into the technologies behind things such as scripting. Realistically it's usually impractical to use your own engine unless you are making a simple project.
Advanced challenge if you want to get into 3d
Make a simple 3d model loader (MD2 is reccommended).
Expand your model loader to allow for keyframe animation.
Expert Games Maths
- Quaternions vs Euler rotation
- Inverse kinematics/bone animation
Expert Graphics
- Shaders.
Expect to take years before you are truelly accomplished. If you have gotten to the stage where you are using someone elses game engine and have dumped your own then you are of about the average level of someone leaving uni that did a games degree I would think. The beginner topics wont take you nearly as long as the rest to explore which is good . A final word of advice, obviously don't get ahead of yourself this list is a listing for someone who would want to become a proffessional level games programmer. This list isn't comprehensive, it eludes to alot of the stuff you should start to learn and expects you to research what areas.
-
- Chaos Rift Newbie
- Posts: 29
- Joined: Sat Oct 17, 2009 4:19 pm
Re: need ideas
This is what I have made so far
Code: Select all
#include <iostream>
#include <stdlib.h>
#include <string>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
cout << "what would you like your name to be?" << endl;
string name;
cin >> name;
cout << "hello nice to meet you " << name << endl;
system ("PAUSE");
cout << "what is your favorite number " << name << endl;
int x;
cin >> x;
cout << "Your favorite number is " << x << endl;
system ("PAUSE");
return 0;
}
- davidthefat
- Chaos Rift Maniac
- Posts: 529
- Joined: Mon Nov 10, 2008 3:51 pm
- Current Project: Fully Autonomous Robot
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: California
- Contact:
- Pennywise
- Chaos Rift Cool Newbie
- Posts: 55
- Joined: Tue Sep 22, 2009 1:36 pm
- Favorite Gaming Platforms: Megadrive(Genesis), Dreamcast, SNES, Nintendo 64
- Programming Language of Choice: C, C++ and Java
- Location: England
Re: need ideas
Remember to start small and work your way up. If you start game development to early, you may lose interest in programming overall.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: need ideas
Please do not get into the habit of using "system("PAUSE");" in your program to wait for a keystroke.killercoder wrote:This is what I have made so far
Code: Select all
#include <iostream> #include <stdlib.h> #include <string> #include <math.h> using namespace std; int main(int argc, char *argv[]) { cout << "what would you like your name to be?" << endl; string name; cin >> name; cout << "hello nice to meet you " << name << endl; system ("PAUSE"); cout << "what is your favorite number " << name << endl; int x; cin >> x; cout << "Your favorite number is " << x << endl; system ("PAUSE"); return 0; }
Using cin.get(); or similar is a thousand times more efficient.
Read More
Last edited by dandymcgee on Sun Oct 25, 2009 2:28 pm, edited 1 time in total.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
-
- Chaos Rift Newbie
- Posts: 29
- Joined: Sat Oct 17, 2009 4:19 pm
Re: need ideas
Ohh thank you very much for the advice ill break that bad habit
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: need ideas
Also, not sure why you're including math.h, you only need this for functions like sqrt(), sin(), etc.killercoder wrote:Ohh thank you very much for the advice ill break that bad habit
Oh and you don't need stdlib.h anymore either (cin.get() is defined in iostream).
Good start, keep playing with it.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
-
- Chaos Rift Newbie
- Posts: 29
- Joined: Sat Oct 17, 2009 4:19 pm
Re: need ideas
Code: Select all
#include <iostream>
#include <stdlib.h>
#include <string>
#include <conio.h>
using namespace std;
int main(int argc, char *argv[])
{
int x;
int c = x + 5;
string name;
int answer1;
cout << "what would you like your name to be?" << endl;
cout << ">"; cin >> name;
cout << "hello nice to meet you " << name << endl;
system ("PAUSE");
cout << "what is your favorite number " << name << endl;
cout << ">"; cin >> x;
cout << "Your favorite number is " << x << endl;
system ("PAUSE");
cout << "what is your favourite number +5?" << endl;
cout << ">"; cin >> c;
if( c != x+5 )
cout << "Wrong@@@@" << endl;
else if( c = x+5 )
cout << "Correct!!" << endl;
}
P.S. It's a nooby mistake I bet lol.
Re: need ideas
You didn't assign a value to x before you started using it.