Bay 12 Games Forum

Finally... => Life Advice => Topic started by: qwertyuiopas on September 21, 2007, 04:47:00 pm

Title: Where can I learn C/C++?
Post by: qwertyuiopas on September 21, 2007, 04:47:00 pm
I already know a few things(I wrote a few DLLs for Mcell, but it was copy/paste then fill in with a custom set of ifs) and I am looking for a good place to learn about graphics. any suggestions?
Title: Re: Where can I learn C/C++?
Post by: Tormy on September 21, 2007, 04:57:00 pm
what about...in a school?   :D
Title: Re: Where can I learn C/C++?
Post by: qwertyuiopas on September 21, 2007, 05:24:00 pm
what about..... school is not into C, only turing. And if they were into C, I would be ahead of them.
Title: Re: Where can I learn C/C++?
Post by: Gaulgath on September 21, 2007, 09:58:00 pm
Check the library - they usually have all sorts of books about getting into all sorts of programming languages.
Title: Re: Where can I learn C/C++?
Post by: Sappho on September 21, 2007, 10:04:00 pm
Community/Junior colleges generally have classes for this sort of thing, but since you said "the school" I'm assuming you're still in middle or high school and not yet college aged.  Still, if you check your local community college you might find that they will let you take a class - of course, you'd have to pay for that.

If college isn't an option, then your best bet is probably books.  Libraries always have them for free - if not in your school, then in your public library for sure.  If you live far enough out into the middle of nowhere that your library doesn't have computer books, then I am very sorry for you indeed.

If self-teaching works for you, you can also just try internet tutorials.  I've heard there's a web site called Google where you can search for things like that.

Good luck!  Hope you find a solution.

Title: Re: Where can I learn C/C++?
Post by: Fourth Triad on September 22, 2007, 01:10:00 am
Try searching university websites for textbooks, sometimes they'll have free ones you can download that profs have written.    :) Oh and wikipedia has a computer programming section. Not sure if any of that helps, but good luck!

[ September 22, 2007: Message edited by: Fourth Triad ]

Title: Re: Where can I learn C/C++?
Post by: Grue on September 22, 2007, 03:49:00 am
Don't. It's an ugly language, choose something better.
Title: Re: Where can I learn C/C++?
Post by: Jonathan S. Fox on September 22, 2007, 05:18:00 am
"Don't learn C/C++" is bad advice to give without caveats. For example, in the games industry, if you don't know C or C++, you'll be stuck making cell phone games and Bejeweled. I've never seen a decent finished ASCII console game that I knew to be coded in another language than C or C++. Roguelikes are almost all, if not all written in C or C++. Want to learn the tricks that went into Nethack or Angband? You need to know know C to dissect the beast. Want to see what the Liberal Crime Squad source is like? You'll want to know C++ if you want to know what you're looking it. You may not like C and C++, but from Mario to Dwarf Fortress to the very operating systems you work on, Java ain't exactly the lingua franca of software.
Title: Re: Where can I learn C/C++?
Post by: 4bh0r53n on September 22, 2007, 05:40:00 am
quote:
I've never seen a decent finished ASCII console game that I knew to be coded in another language than C or C++.

try Mazecrawl, its coded in Pascal/Delphi, its not yet finished, but its in alpha atm

Title: Re: Where can I learn C/C++?
Post by: Tormy on September 22, 2007, 05:50:00 am
quote:
Originally posted by Sappho:
<STRONG>Community/Junior colleges generally have classes for this sort of thing, but since you said "the school" I'm assuming you're still in middle or high school and not yet college aged.  </STRONG>

Wrong I am not in school but I am not working either. I am a poker player.
 :D

Title: Re: Where can I learn C/C++?
Post by: qwertyuiopas on September 22, 2007, 05:57:00 am
I tried google, but the tutorials there are either too simple or too complicated.
What I really want, is a good game/graphics tutorial.
Hmm.... maybe I could look over the nethack source code... I already have it, but its a huge mess.

Oh wait... compiler has windows examples too.

[ September 22, 2007: Message edited by: qwertyuiopas ]

Title: Re: Where can I learn C/C++?
Post by: Karnaugh on September 22, 2007, 07:28:00 am
Lippman's C++ primer is a very good introduction to C++. You can probably get it from a lot of libraries, but a used one costs 3.45USD on amazon...

I hate to be this dull, but before you start thinking about graphics you should learn many other things. Just as an example, try to figure out how you would make a character intelligently move from one spot to another - and I'm not talking about animation now. (Try this http://www.policyalmanac.org/games/aStarTutorial.htm).

Once you have a good hang of programming (and game design), you can get a ready made graphics middle ware so there's no need to do everything from scratch. Garagegames sells a decent, but cheap engine. There are free ones as well, but there is less support (and more bugs, inferior performance).

Title: Re: Where can I learn C/C++?
Post by: qwertyuiopas on September 22, 2007, 08:47:00 am
What I want, is a good way to draw to a windows window.
I have a small program modification, I am using as a debugging version, but it uses.....
console text to render a raycasted picture XD
and the console does not support real time.
I found a few examples, so I may use those....
Title: Re: Where can I learn C/C++?
Post by: kuro_suna on September 22, 2007, 12:09:00 pm
quote:
Originally posted by qwertyuiopas:
[QB]What I want, is a good way to draw to a windows window.
/QB]


sdl tutorial

Title: Re: Where can I learn C/C++?
Post by: Jonathan S. Fox on September 22, 2007, 12:24:00 pm
quote:
Originally posted by 4bh0r53n:
<STRONG>

try Mazecrawl, its coded in Pascal/Delphi, its not yet finished, but its in alpha atm</STRONG>


Okay, that's close enough for me.  ;)

Title: Re: Where can I learn C/C++?
Post by: Grue on September 22, 2007, 02:37:00 pm
quote:
I've never seen a decent finished ASCII console game that I knew to be coded in another language than C or C++. Roguelikes are almost all, if not all written in C or C++.

You have to play more roguelikes then. There were a lot of programming languages used to create various roguelikes. I wrote 3 roguelikes in Common Lisp. DoomRL is written in Pascal (though I think Pascal is even worse than C in terms of expressive power). The first roguelike, Rogue was written before C was even conceived. Knowing C is good if you want to mantain legacy code, but if you're starting a new project, it's better to choose something different.

By the way, MazeCrawl won't be developed further, according to its developer, so it can qualify as "finished", but probably not "decent" enough   ;)

[ September 22, 2007: Message edited by: Grue ]

Title: Re: Where can I learn C/C++?
Post by: Jaqie Fox on September 23, 2007, 08:34:00 am
C++ is not a language to learn C family with.

Get Microsoft visual C# 2005 express, for free, and Oreily's learning C# book (can be had for $20ish at amazon.com).

The reason: all C languages share a common root 'language' and each use their own 'dialect' for a comparative analogy, so you can learn one and have a pretty good grasp on others.
The reason for C# first: it has all the 'piping' done for you... you don't need to worry about coding or finding a 3D library, a UI library, et cetra ad infinitum. it's a *HELL* of a lot less hassle to learn, and it gets you in on the ground floor very very well on all other C based languages.  It also has automatic 'trash' cleanup, no worry about memory leaks and cleaning up your own 'trash' with it.

Title: Re: Where can I learn C/C++?
Post by: qwertyuiopas on September 23, 2007, 08:48:00 am
I have it. but do you know how hard setting up the code to recieve keyboard input in a windows forum is? MSVC# express is not very good for one reason: you need a component framework to run the programs. And it makes bulky, large results, probably with extra things slowing it down.

I am writing a command line interpreter for one of those odd and useless languages in C. All I have left is to add binary output(by bits) and fix text output to files.

[ September 23, 2007: Message edited by: qwertyuiopas ]

Title: Re: Where can I learn C/C++?
Post by: Jaqie Fox on September 23, 2007, 09:51:00 am
With as hard as MS is pushing .NET (they are betting their whole company on it) and how good it runs (after JIT compiles most of the code on your machine (which it only needs to do once), it runs almost as fast as optimized C++ code), there's no real reason not to use it.  As with the shortcoming you are speaking of, you can get down 'into the guts' of it when you need to and change things.  I am not a fan of most things MS does, but .NET is definitely a huge leap forward in the right direction.
Title: Re: Where can I learn C/C++?
Post by: qwertyuiopas on September 23, 2007, 02:13:00 pm
fine: you try making a roguelike using a windows forum as a drawing surface and see if YOU can get it to read keyboard input.
I eventually gave up and went for VB because I could get it to read input.
Title: Re: Where can I learn C/C++?
Post by: Jaqie Fox on September 23, 2007, 07:58:00 pm
a "windows forum"? Just what, praytell, is that?