Page 1 of 2

COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Dec 19, 2009 11:12 pm
by Fallental
:D SOOO Im real excited about this project idea i came up with, if anyone would like to join me, just tell me!

Ok so heres my project A C++ Program that acts as a dictionary that i could implement into a game or just a quick dictionary.

So say i want to to know the definition of noob: I woulde type /noob

and the output would be: A Player new to the game.

I want it to be functional yet editable and for use in later projects!

I have basic knowledge in C++ And i think i can pull it off!

Also,(If possible) I would like to have it so players can make their own definitions like typing /createdef awesome "Very cool"

In quotes would be definition, and the definitions would be stored to a file.
I dont know just ideas! please feel free to comment!

Thanks,
Fallental 8)

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Dec 19, 2009 11:20 pm
by thbp
Umm first rite the dictionary then later intergrate it with the game...... wouldn't that be much easier?

and to be honest wouldnt this require somethign like......
get directive
if direcive def
get code from file

if add
save file to code in xml


amd i close?

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Dec 19, 2009 11:25 pm
by Fallental
Im not working on a game.

I just want to make a dictionary

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Dec 19, 2009 11:35 pm
by thbp
i mean the dictionary part would be easy embedding into game wouldn't tha be hard???

my basic code that i think i should pos that may work (idk i'm a complete newb)

Code: Select all

#include <iostream>
#include <string>
using namespace std;

int main() {
string getDir;
cin >> getDir;
if (getDir = add) {
//code to get xml file data
}
else if (getDir = find) {
//get xml data
}
else {
cout << "enter rite keyword";
}

return 0;
|



am i close with a basic dictionary?

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Dec 19, 2009 11:41 pm
by Fallental
Thanks for the psuedocode. Im not sure if you are rite with it ill tinker with it, i am new to c++

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:08 am
by Falco Girgis
thbp wrote:i mean the dictionary part would be easy embedding into game wouldn't tha be hard???

my basic code that i think i should pos that may work (idk i'm a complete newb)

Code: Select all

#include <iostream>
#include <string>
using namespace std;

int main() {
string getDir;
cin >> getDir;
if (getDir = add) {
//code to get xml file data
}
else if (getDir = find) {
//get xml data
}
else {
cout << "enter rite keyword";
}

return 0;
|



am i close with a basic dictionary?
Dude... really?

Code: Select all

if (getDir = add) {
*facepalm*

I'm just being a dick.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:20 am
by thbp
whoa are you saying about my

Code: Select all

if (getDir = "add") 
mess up? if so it's normal for me most my comparisons are of variables like it would be

Code: Select all

string add = "add"
don't ask me why but it makes my code feel cleaner i guess (though it's not)

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:24 am
by Fallental
please explain how your code works

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:34 am
by thbp

Code: Select all

//preprocessors
#include <iostream>
#include <string>
using namespace std;

//main 
int main() {

//declare string to get
string getDir;

//get string
cin >> getDir;

//Dending on input of Add or Find you will do the following 
if (getDir = "add") {
//this code will allow you to update your dictionary (i don't know ow to code this so i'll leave it blank)
}

else if (getDir = "find") {
//search your xml data base for keywords 
}

else {
// to get the rite one (needs loop but too lazy to put in)
cout << "enter rite keyword";
}

// end program
return 0;
|
above code would have to generate the tags then be able to find the tags once again.
then edit them (optional) to be correct)

EDITED THE FOLLOWING TYPO'S TO BE CORRECT (i think)
xml (example) (god i hope i'm rite)

Code: Select all

<dict> 
<world one>
<def>A nice word </def>
</wrordone>
<word2>
<!---more crap here//--->
</word2>
</dict>

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:49 am
by Fallental
im gonna sound hella stoopid but here it goes.



what is xml :shock2:

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:00 am
by thbp
CRASH COURSE ON BASICS (like real basics)

eXtesible Markup Language (xml)

you difine you own tags to mark up your text it's more in my opion a text database kinda (please tell me if i'm wrong).

open notepad and type

Code: Select all

<HI>
<hello> Hello </hello>
<hola> Hola </hola>
</Hi>
save as hi.xml and open in fx (firefox).

some quick rules

1. it is Case senstive
2. always end a tag
3. (personal preference) Always document.
4. Muste be properly nested (<b><I> hello <i><b>
5.must have a root (in example root is <HI></HI>

why use xml?
1. It's awsome
2. cross platform
3. your code can read it and anyone else can no need to make 2 sets a code for two databases
4. can be styled (xslt (i believe)
5. Powerful in alittle way trust me it can be all your data problems (not alway efiecient but usually can (again not sure))

some cool examples of the power of Xml
Rss is used alot (based off xml (actually if i'm rite) it is xml with other components)



some articles
http://www.gamedev.net/reference/articl ... le1928.asp

tutorial
http://www.gamedev.net/reference/progra ... s/modxml1/

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:04 am
by Fallental

Code: Select all

CMarkup xml;
xml.AddElem( "Dictionary" );
xml.AddChildElem( "Noob" );
xml.IntoElem();
xml.AddChildElem( "Def", "A new player" );
xml.AddChildElem( "LOL" );
xml.intoelem();
xml.AddChildElem( "Def", "Laughing out loud" );
CString csXML = xml.GetDoc();
Would this create

Code: Select all

<dictionary>
<noob>
<def>A new player</def>
</noob>
<LOL>
<def>Laughing our loud </def>
</LOL>
</dictionary>
If so how do i implement this piece of code I Created into c++ !

Thanks!
Fallental

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:05 am
by Innerscope
thbp wrote:whoa are you saying about my

Code: Select all

if (getDir = "add") 
mess up? if so it's normal for me most my comparisons are of variables like it would be

Code: Select all

string add = "add"
don't ask me why but it makes my code feel cleaner i guess (though it's not)
That conditional statement is assigning getDir with "add". You need to put == if you're checking for equality.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:05 am
by Fallental
Ah, xml code is similar to html i see

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:07 am
by thbp
hey man not to be mean but i don't know i'm just giving help to the full extent i know. The only way to find out is to try it out best way to learn.

and if it works i just learned something myself