An Introduction to Programming, For beginners
Moderator: Coders of Rage
Re: An Introduction to Programming, For beginners
That's what I had thought I was wondering about that...
Re: An Introduction to Programming, For beginners
So when is 16 coming out?
Hyde from That 70's Show wrote:Woman are like muffins... Once you have a muffin you will do anything to have another muffin... And they know that.
Re: An Introduction to Programming, For beginners
Oh, my bad, remember I'm on two other chats as well lol
- 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: An Introduction to Programming, For beginners
I knew what it meant.. I'm just saying we both said the same thing but you said it with actual code.Ginto8 wrote: You kinda missed my point. You'll have to wait until you get to operator overloading to understand.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: An Introduction to Programming, For beginners
Oh, okay.dandymcgee wrote:I knew what it meant.. I'm just saying we both said the same thing but you said it with actual code.Ginto8 wrote: You kinda missed my point. You'll have to wait until you get to operator overloading to understand.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: An Introduction to Programming, For beginners
I split threads out from here.
User Input started by EvolutionXEngine
Outputting letters as numbers (a=0...) started by cplusplusnoob.
Please use those to continue any applicable discussion of those topics.
User Input started by EvolutionXEngine
Outputting letters as numbers (a=0...) started by cplusplusnoob.
Please use those to continue any applicable discussion of those topics.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: An Introduction to Programming, For beginners
Split another post out.
Random questions don't go here, please make your own thread.
Random questions don't go here, please make your own thread.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
-
- Chaos Rift Newbie
- Posts: 12
- Joined: Mon Feb 02, 2009 8:13 pm
Re: An Introduction to Programming, For beginners
Sooo now I'm trying to learn C++ with the Dummies version... dam... anyways my complier is to executing this..
I copy and paste ..but it says their is an error and i can't figure it out...
please help , explain... Thank You!
I copy and paste ..but it says their is an error and i can't figure it out...
Code: Select all
// BoolTest - compare variables input from the
// keyboard and store the results off
// into a logical variable
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// set output format for bool variables
// to true and false instead
// of 1 and 0
cout.setf(cout.boolalpha);
// initialize two arguments
int nArg1;
cout << “Input value 1: “; <------------------------------------------------ I get the Error right here!
cin >> nArg1;
int nArg2;
cout << “Input value 2: “;
cin >> nArg2;
bool b;
b = nArg1 == nArg2;
cout << “The statement, “ << nArg1
<< “ equals “ << nArg2
<< “ is “ << b
<< endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system(“PAUSEâ€);
return 0;
}
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: An Introduction to Programming, For beginners
EvolutionXEngine: please use
Code: Select all
brackets!
As for the error, can you tell us exactly what the compiler says? Going "OMG I HAS AN ERROR ON THIS LINE WHAT'S WRONG WITH IT????" doesn't help the people trying to help you. If you post the error, it gives your helpers clues as to what they have to look for. :) ;)
I haven't seen you around here before, so welcome to the forum! :mrgreen:
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
-
- Chaos Rift Newbie
- Posts: 12
- Joined: Mon Feb 02, 2009 8:13 pm
Re: An Introduction to Programming, For beginners
Still im reading the C++ book but i want to get an idea of a game structure.
Can anyone help. Such as a 2d or 3d structure... some sort of chart!
Thanks!
Can anyone help. Such as a 2d or 3d structure... some sort of chart!
Thanks!
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: An Introduction to Programming, For beginners
...feel free to make new threads for your issues. Please.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Re: An Introduction to Programming, For beginners
Here's a very, simple representation of perhaps the most basic game setup you could have;
You begin the program, and everything is initialised. Things like images that need to be loaded, models, level files. Anything that is too taxing to do in realtime and should be in memory from the games beginning should be done here.
After this you go into the Game Loop. This is basically a giant while(!exit) loop exit is a boolean that will equal true when it's ready to shutdown the game. Otherwise the loop cycles through infinitely.
A timer is used in almost all modern games to make each iteration of the loop sleepfor a short period. If this wasn't in place the game would run as fast as the computer allows it at all times, background processes would affect game speed and the game would run at different speeds on different supported hardware.
I mention the input logic inside the game loop, but this isn't neccassarily the case. It isn't uncommon for the input logic to be place in a seperate thread so that delays caused by the game running logic don't stop input from being registered. Although in most basic game circumstances you can just put the input in the game loop (Even if it's sloppy).
Here is the most important part of the game, the game logic. Technically speaking you can break this up into all kinds of things like physics, sound, etc. This is the core of the game, it is where all your collision detection updating object positions, creating new objects, etc. is handled. It is your games rules!
Rendering is done after all the game logic has been updated. As it's name suggests this is where you tell your game to get all the locations and states of your objects and render them accordingly. You clear the screen and redraw everything everytime you render.
After rendering has finished you check the state of exit if it changed to true during sometime in the game logic then you exit the game loop, otherwise you start it over again.
Clean-up, we don't want memory leaking, maybe we created a bunch of temp files that are only needed while the game is open for some reason. So after all is done it is important to clean-up allowing the player to close the game in piece without any negative repurcussions.
Thats a very broad and general outline of how a game is structured. People try and keep everything modular (e.g. the renderer, the physics, etc.) so that it can be easily read and that you can re-use parts easily. This is why there are physics engines, graphics engines, etc.
You begin the program, and everything is initialised. Things like images that need to be loaded, models, level files. Anything that is too taxing to do in realtime and should be in memory from the games beginning should be done here.
After this you go into the Game Loop. This is basically a giant while(!exit) loop exit is a boolean that will equal true when it's ready to shutdown the game. Otherwise the loop cycles through infinitely.
A timer is used in almost all modern games to make each iteration of the loop sleepfor a short period. If this wasn't in place the game would run as fast as the computer allows it at all times, background processes would affect game speed and the game would run at different speeds on different supported hardware.
I mention the input logic inside the game loop, but this isn't neccassarily the case. It isn't uncommon for the input logic to be place in a seperate thread so that delays caused by the game running logic don't stop input from being registered. Although in most basic game circumstances you can just put the input in the game loop (Even if it's sloppy).
Here is the most important part of the game, the game logic. Technically speaking you can break this up into all kinds of things like physics, sound, etc. This is the core of the game, it is where all your collision detection updating object positions, creating new objects, etc. is handled. It is your games rules!
Rendering is done after all the game logic has been updated. As it's name suggests this is where you tell your game to get all the locations and states of your objects and render them accordingly. You clear the screen and redraw everything everytime you render.
After rendering has finished you check the state of exit if it changed to true during sometime in the game logic then you exit the game loop, otherwise you start it over again.
Clean-up, we don't want memory leaking, maybe we created a bunch of temp files that are only needed while the game is open for some reason. So after all is done it is important to clean-up allowing the player to close the game in piece without any negative repurcussions.
Thats a very broad and general outline of how a game is structured. People try and keep everything modular (e.g. the renderer, the physics, etc.) so that it can be easily read and that you can re-use parts easily. This is why there are physics engines, graphics engines, etc.
-
- Chaos Rift Newbie
- Posts: 30
- Joined: Sat Dec 19, 2009 5:00 pm
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C#
- Location: Bosnia and Herzegovina
Re: An Introduction to Programming, For beginners
What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
"There is nothing either good or bad, but our thinking makes it so"
- OmegaGDS
- Chaos Rift Regular
- Posts: 123
- Joined: Mon Jan 18, 2010 3:20 am
- Current Project: GMN (C++)
- Favorite Gaming Platforms: PC, PSP / Psp Emulation, GameCube, SNES, NES
- Programming Language of Choice: C++
- Location: Kentucky
- Contact:
Re: An Introduction to Programming, For beginners
Have you heard of F#? Apparently it is being made by the same guy who made C#, and it will be better. I'm not even sure if the F# thing is true though, can someone confirm? For now, I thing Java and C++ will be the big ones in the future. well... scratch java.EdEown wrote:What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: An Introduction to Programming, For beginners
Yes there is a language called F#. It's a .Net language and it's not even close to new, it first appeared around 2002 although it isn't distributed yet it will be shipped with Visual Studio 2010 or so we're told...........OmegaGDS wrote:Have you heard of F#? Apparently it is being made by the same guy who made C#, and it will be better. I'm not even sure if the F# thing is true though, can someone confirm? For now, I thing Java and C++ will be the big ones in the future. well... scratch java.EdEown wrote:What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup