Forum

> > Off Topic > C++ Tutorial
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch C++ Tutorial

128 Antworten
Seite
Zum Anfang Vorherige 1 2 3 4 5 6 7 Nächste Zum Anfang

alt Re: C++ Tutorial

Lee
Moderator Off Offline

Zitieren
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.

alt Re: C++ Tutorial

archmage
User Off Offline

Zitieren
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?
Mehr >


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

alt Re: C++ Tutorial

archmage
User Off Offline

Zitieren
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?

alt Re: C++ Tutorial

Flacko
User Off Offline

Zitieren
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.
1× editiert, zuletzt 27.10.10 03:06:04

alt Re: C++ Tutorial

archmage
User Off Offline

Zitieren
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
Mehr >



include.h
Mehr >



map.cpp
Mehr >



controls.cpp
Mehr >



objects.cpp
Mehr >



keys.cpp
Mehr >
7× editiert, zuletzt 07.11.10 06:06:14

alt Re: C++ Tutorial

Patasuss
User Off Offline

Zitieren
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.

alt Re: C++ Tutorial

Lee
Moderator Off Offline

Zitieren
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.)

alt Re: C++ Tutorial

Patasuss
User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 2 3 4 5 6 7 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht