Well if you want to go for it citizen. So far the last valid submission was my original post :(
Quote:
Originally Posted by rules
Printable View
Well if you want to go for it citizen. So far the last valid submission was my original post :(
Quote:
Originally Posted by rules
Hmmm.
Let's stop making life so hard on us... When we have C++, let's use it! ;)Code:class BRAIN
{
public:
BRAIN(): bHasBrain(false) { }
bool bHasBrain;
};
struct DATE
{
WORD year;
WORD month;
WORD day;
WORD hour;
WORD minute;
WORD second;
WORD millisecond;
};
enum gender
{
female,
male
};
struct HUMAN
{
// version 3
// family
HUMAN* mother;
HUMAN* father;
std::vector<HUMAN*> children;
DWORD dwChildren;
// specifiers
gender sex;
std::string name;
double x, y, z;
DATE birth;
// more
BRAIN mem;
};
And I still prefer tabs. You stole my quote, and now you try to steal it again? :rolleyes:
Elysia: could you please put that in a file w/ relevant includes and stuff in a form that will compile and maybe do something? That would give the next person something to work with :)
>> And here I was just going to do a stupid little die roll, and make "Bob" walk somewhere.
Ah, great idea!
Code:BOOL HUMAN::Rotate(double rads)
{
rot = rads;
return TRUE;
}
BOOL HUMAN::Walk(double distance)
{
x += cos(rot) * distance;
y += sin(rot) * distance;
z = GetHeightMap(NULL, x, y);
return TRUE;
}
That's a horrible class. Each instance of HUMAN has a children vector, even if a particular human is only part of a family. Some humans don't have children so I'm not sure if that is a part of being human. Not to mention that we're using WORDS and DWORDS, which isn't very cross-platform, but mike wants it to work on g++.
Hmmm, with these problems, I think I liked Bob more.
Going somewhere with the class, Elysia?
Yarin: thanks for that. :p
Putting it into something compilable now.
Alright, here's the source, tested and everything.
Now feel free to continue building on it.
how about making them reproduce now! without any help from programmers!
If you want it, go ahead, code it ;)
My build has a few issues with that.
Quote:
start.cpp:1:20: stdafx.h: No such file or directory
start.cpp:13: error: use of enum `gender' without previous declaration
start.cpp:17: error: `gender' was not declared in this scope
start.cpp:18: error: `gender' was not declared in this scope
start.cpp:19: error: `gender' was not declared in this scope
start.cpp: In function `std::string GetChildType(gender)':
start.cpp:89: error: `std::string GetChildType(gender)' redeclared as different kind of symbol
start.cpp:17: error: previous declaration of `std::string GetChildType'
start.cpp:17: error: previous non-function declaration `std::string GetChildType'
start.cpp:89: error: conflicts with function declaration `std::string GetChildType(gender)'
start.cpp: In function `std::string GetHisHer(gender)':
start.cpp:100: error: `std::string GetHisHer(gender)' redeclared as different kind of symbol
start.cpp:18: error: previous declaration of `std::string GetHisHer'
start.cpp:18: error: previous non-function declaration `std::string GetHisHer'
start.cpp:100: error: conflicts with function declaration `std::string GetHisHer(gender)'
start.cpp: In function `std::string GetHeShe(gender)':
start.cpp:111: error: `std::string GetHeShe(gender)' redeclared as different kind of symbol
start.cpp:19: error: previous declaration of `std::string GetHeShe'
start.cpp:19: error: previous non-function declaration `std::string GetHeShe'
start.cpp:111: error: conflicts with function declaration `std::string GetHeShe(gender)'
start.cpp: In function `void DisplayChildren(const HUMAN&)':
start.cpp:148: error: no match for call to `(std::string) (gender&)'
start.cpp:148: error: no match for call to `(std::string) (gender&)'
*** Errors occurred during this build ***
How about this then?
Disabled precompiled headers.
Moved declarations and definitions to top, above the prototypes.
That'll play. Danke.