Forum

> > Off Topic > C++ Tutorial
Forums overviewOff Topic overviewLog in to reply

English C++ Tutorial

128 replies
Page
To the start Previous 1 2 3 4 5 6 7 Next To the start

old Re: C++ Tutorial

Lee
Moderator Off Offline

Quote
If they offer a static library, you can statically link to it and thus integrate it into your program.

You can implement the tic-tac-toe AI as a tree. One of the neat things about this is that you can do very few look-aheads and still be able to find every possible gameplay by pivoting around sets of nodes.

old Re: C++ Tutorial

archmage
User Off Offline

Quote
I fixed the problem with a vector of classes.
http://www.filefactory.com/file/b3dgg4f/n/sfmltest03.7z

EDit
Is there a better way to do this?
More >


PS: I did not write all that I used Lua to do it for me. I am too lazy to hand write all that.
edited 5×, last 10.10.10 04:26:21 am

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Well, never mind that I have it working. But what would be a good way to find if the input string when drawn on the screen is longer that the box? Using font size width and height of the box?

old Re: C++ Tutorial

Flacko
User Off Offline

Quote
I think SFML should have a function for this, atleast allegro does.
Notice that TTF fonts have different widths on every character so a simple multiplication won't work.
edited 1×, last 27.10.10 03:06:04 am

old Re: C++ Tutorial

archmage
User Off Offline

Quote
What is wrong with this? It compiles with no output to the console, but when I run it I get this error "... is not a valid Win32 program."

Command line:
g++ main.cpp -static-libstdc++ -static-libgcc

main.cpp
More >



include.h
More >



map.cpp
More >



controls.cpp
More >



objects.cpp
More >



keys.cpp
More >
edited 7×, last 07.11.10 06:06:14 am

old Re: C++ Tutorial

Patasuss
User Off Offline

Quote
Hi,
I know this thread is a little bit old (133 days), but I have a question:
Do you have some sites where I could learn how to make a simple (and i mean SIMPLE SIMPLE) compiler in C/C++?
Or creating an .exe file that does something. (simple console output would be a good start)
EDIT: I don't want to compile C++ code, I want to create a compiler for my own (LITTLE) scripting language.

old Re: C++ Tutorial

Lee
Moderator Off Offline

Quote
http://networks.cs.ucdavis.edu/~amitabha/code.html

Scheme is one of the easiest to implement languages out there. To create a full fledged language, you will need to learn to use one of several DSL specific toolkits (lex comes to mind), how to implement, build, and traverse AST trees, and how to atomically represent computations with a bijection into the actual computation space. These are the primitives for building your own language. (By compiler I assume you mean an interpretor, as the output produced by a compiler is not executable.)

old Re: C++ Tutorial

Patasuss
User Off Offline

Quote
Thanks for the link,
but I just wanted to know if there's a way to create .exe files with C/C++.....
Spoiler >


And it's not that i want to start a big project, I'm just curious.
To the start Previous 1 2 3 4 5 6 7 Next To the start
Log in to replyOff Topic overviewForums overview