So I’ve been trying to do the finite state AI puzzle and I’m missing something obvious or it is poorly worded. So I deduced that the initial while loops are there to gather information for the bots to use. Now using this bit of code which I will link at the bottom. I access the sample data 1. And then based on the costA etc I collect the molecules and then drop them off at the laboratory. But It says that the data is still in the cloud? Any help?
Code:
requiredMolecules[] req = new requiredMolecules[5];
Console.WriteLine("GOTO DIAGNOSIS");
Console.WriteLine("CONNECT 1");
Console.WriteLine("GOTO MOLECULES");
for(int i = 0; i < 4; i++){
switch (i){
case 0:
req[i].letter = 'A';
req[i].number = A;
break;
case 1:
req[i].letter = 'B';
req[i].number = B;
break;
case 2:
req[i].letter = 'C';
req[i].number = C;
break;
case 3:
req[i].letter = 'D';
req[i].number = D;
break;
case 4:
req[i].letter = 'E';
req[i].number = E;
break;
}
}
for(int i = 0; i < 4;i++){
if (req[i].number > 0){
for (int k = 0; k < req[i].number;k++){
Console.WriteLine("CONNECT " + req[i].letter);
}
}
}
Console.WriteLine("GOTO LABORATORY");
Console.WriteLine("CONNECT 1");
requiredMolecules is my own custom type which contains a letter char and number of required molecules of the related char.
Ah so I think what your saying is I’m doing everything in the equivalence of 1 turn. And that’s resulting in everything going out of sync? So I have to do one action. Then let the game update, then do another action?
I did the same mistake at first and spent a lot of time trying to understand what was wrong (I had written two commands in the same turn). Now I’m more careful about what I wirte .
Ok now I’ve got the problem of the sample molecules not working still. This code should write one line at a time (It’s called once every while loop). Also after taking the sample, I gather the current costA etc into static ints (this is updated only once). Then the if statements filter through slowly collecting the molecules. When all equal 0, it moves to the lab and submits the sample data and molecules. But it says they are incorrect? :S!