Author Topic: C++ help, help my education!  (Read 1619 times)

Gabbe

  • Guest
C++ help, help my education!
« on: 17 June 2010, 22:45:25 »
Im asking for help, or rather begging lol okay, not wuite that drastic, i need help for a program. I want a background image with the task running in front.

I want it for example,

I got 300 ccurrency, and i want to buy something that costs 200. I want the program to calculate how much money i have left. not only with the given numbers, but with others aswell. with a image in hte background.

My skills are limited, i don`t want you to say, do this and this, i want you to tell me what kinds of code i need and integers and etc. and then i can figure out how to put the different integers and code into the program. I do know some basics, but i want a challenge, don`t ask me what i know, I don`t want you to know, since you can assume im a noob, but not how much noob, will give me a challenge :D

All this is for my education, i ask here since i know some coders are here, devs GAE MG, and probably someone else know aswell. I`ll post my procedure here, remember, educational purpose only!

Also, i need a compile program or whatever it is called. I am called to a interview with a "higher school" well, you don`t know the Norwegian school system do you. anyways, i am called to a interview in a year, and i need to know more code, the education is going to be both code and art(3d) so later, i`ll probabyl need some help on that too.

the needed criteria for you to apply for interview was 4.5 and im at 5.8/6 possible. that equals 6, so im full, that is A+ i think.

Okay, so my education is going the right way! GameDev! ftw!

3-year period so there might be updates here a lot, you guys can see al my work too :) hope you enjoy as i proceed.

If i fail BTW, i still work with code,

kukac2

  • Guest
Re: C++ help, help my education!
« Reply #1 on: 18 June 2010, 07:26:31 »
I don't really get what you mean :)

If you have 300 money, and you buy something for 200, then you will have 100 money (at this example, integer would be enough, but as money, real would be better).

Basically, A:=300; B:=200; A:=A-B;

Where A and B are variables.

Gabbe

  • Guest
Re: C++ help, help my education!
« Reply #2 on: 18 June 2010, 12:57:21 »
okay, will try...using codeblocks compiler.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: C++ help, help my education!
« Reply #3 on: 18 June 2010, 22:39:37 »
For an image, that may be the hardest part. Options are:
-Windows only, use the windows API. Easy, but not cross-platform. Since nobody would need such a program, there's no need for cross platform though, is there?
-Use an engine. Easiest, but can be done with literally a few lines of code. You could do this entire project in Irrlicht in 20 minutes (assuming you have the experience, so maybe an hour or two of looking at the tutorials first). Another engine that could make this done in a very short span of time is Qt. You'll probably spend more time downloading the huge thing than coding the project!
-Use hardcore c++ with no engine. Not for you. Way out of the task abilities of a beginner.

Otherwise, the program is very easy.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Gabbe

  • Guest
Re: C++ help, help my education!
« Reply #4 on: 19 June 2010, 11:12:12 »
I`ll give the hardcore a shot :) i really need to learn y`know anyways, i think i can do it now thanks

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: C++ help, help my education!
« Reply #5 on: 22 June 2010, 03:15:04 »
If you were going to go Windows only it would be easier to use MFC rather than a straight Windows API.

The other option is to use SDL, which is what Glest uses to create a window. Besides that it can load and display images and text for you. If you have trouble with C++ it might be better to start with python which also has a library that uses SDL called pygame.
« Last Edit: 22 June 2010, 03:18:28 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: C++ help, help my education!
« Reply #6 on: 22 June 2010, 03:21:17 »
I`ll give the hardcore a shot :) i really need to learn y`know anyways, i think i can do it now thanks
Dude don't... This is what breaks people in half... Then quarters, then smaller and smaller till you don't exist anymore.

SDL is great too, and very easy to use.

I actually wouldn't recommend python because its not very similar to c++. In fact, it can do more things and ends up making things a bit too easy with so many libraries. The thing I dislike about python is that it depends on tabs, not braces {} for functions, etc. Also, keywords that are normally a symbol are actual words, which can make it easier, but more difficult to convert. Up to you of course.

An alternative I would recommend to learn the basics of coding (but not anything much) is Javascript, since it has some big simularities in style, and is also OOP (so is python, though). Of course, nothing to stop you from dwelving right into C++.

Of course, also note that hailstone could code circles around me, so his advice is probably better than mine.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Gabbe

  • Guest
Re: C++ help, help my education!
« Reply #7 on: 22 June 2010, 15:53:59 »
:o okay, but im going for the c++, i`ve heard that there is something only C but idk if im going to try that.. :|

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: C++ help, help my education!
« Reply #8 on: 1 July 2010, 08:39:48 »
C++ is a superset of C. If you're not going to be programming in C you might as well just learn C++.

I found some good lectures from Stanford University on Youtube if you're able to understand English speakers.

Each link is the start video of a unit:
Lecture 1 | Programming Paradigms (Stanford) - introduction to programming by looking at many languages and concurrency and other stuff
Lecture 1 | Programming Abstractions (Stanford) - uses C++ to look at different programming techniques
Lecture 1 | Programming Methodology (Stanford) - software engineering principles using Java
« Last Edit: 1 July 2010, 08:50:30 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/