diff --git a/gmo.cpp b/gmo.cpp new file mode 100644 index 0000000..9cea8f4 --- /dev/null +++ b/gmo.cpp @@ -0,0 +1,123 @@ +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +string generateValue() { + + char trash[100]; + string x = itoa(((rand() % 10) * 100 + (rand() % 10) *10 + (rand() % 10)),trash,10); + if (x.size() == 2) { + x = "0" + x; + } + else if (x.size() == 1) { + x = "00" + x; + } + + return x; + +} + + +string generateVegetable() { + + string taste = generateValue(); + string colour = generateValue(); + string size = generateValue(); + + return taste + colour + size; + +} + + +void generatePopulation(string * population,int length) { + + int i; + for(i=0;i()); + + for(i=0;i