| View previous topic :: View next topic |
| Author |
Message |
JDTAY
obseletes now
|
Posted: Sat Oct 06, 2001 2:35 pm Post subject: 1 |
|
|
| For those that don't use AIM, I've been programming a bot, or program that imitates a real AIM user by responding to messages according to set of instructions in it's program, called SpinachEater to moderate starship games on AIM. I have found two bugs in SpinachEater which have been preventing him from doing this. The first has to do with using wrong types of 'if then' statements, and the second has to do with how Spinach says variables in his messages. I expect Spinach to be ready for testing tomorrow. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sat Oct 06, 2001 3:24 pm Post subject: 3 |
|
|
I fixed all the variables in dialogue. I had it like this: "word word", $variable, "word word." When varibles are supposed to go straight into dialogue like this: "word word $variable word word."
Now comes the hard part. Fixing the 'if then's may cause me to have to restructure the program. |
|
| Back to top |
|
 |
ChienFou
Leader of the pack
|
Posted: Sat Oct 06, 2001 3:38 pm Post subject: 4 |
|
|
Many years ago, probably round about the birth of the universe I learnt that the *ONLY* way to program an IF .. THEN is in the following structure (and actually laid out this way)
code:
IF <cond> THEN
block
END ELSE
block where block can be a NULL statement
END
This way you guarantee a termination of the IF and the problems with hanging ELSE's evaporate.
cheers ChienFou
[This message has been edited by ChienFou (edited 10-06-2001).] |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sat Oct 06, 2001 5:07 pm Post subject: 5 |
|
|
| I've figured out how to restructure the 'if then' statements. Testing should sart between 1:30 and 2:00 and end at an unknown time. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sat Oct 06, 2001 5:25 pm Post subject: 6 |
|
|
| Okay, no testing until I can get a hold of Hy. |
|
| Back to top |
|
 |
Chuck
Daedalian Member
|
Posted: Sat Oct 06, 2001 5:31 pm Post subject: 7 |
|
|
In PERL I think it's something like:
IF condition {do this stuff} ELSE {do this instead}
Statement blocks are in braces. Or maybe that's in C, or JAVA, or something. |
|
| Back to top |
|
 |
HyToFry
Drama queen
|
Posted: Sun Oct 07, 2001 7:14 am Post subject: 8 |
|
|
Chuck is close...
code:
if (condition) {
statement1;
statement2;
statement3;
} else {
statement4;
}
The else is strictly optional, there is also an elsif statement.
if (something) {
this;
} elsif (somethingelse) {
that;
} else {
null;
}
You can have as many or as few elsif statements as you want, and the spacing is unimportant.
if (this == happens) {do this;} else {do that;}
you can even have an if statement after the fact.
code:
$message = "Hello $nickname";
$message = "Goodbye $nickname" if $status eq "exit";
and
if ($status eq "exit") {
$message = "Goodbye $nickname";
} else {
$message = "Hello $nickname";
}
Are basically the same statement.
|
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 1:05 pm Post subject: 9 |
|
|
Okay, although they may have been an error in the 'if then' statements, I think I may have saw more error than was there and overfixed it. SE may be ready for testing in an hour, he may be ready for testing never. It all depends on whether really really smart programmer dudes who create their own languages think a lot like me.
.
.
.
.
.
.
.
.
.
.
.
We're doomed. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 1:19 pm Post subject: 10 |
|
|
YYYYYYYYYYYEEEEEEEEEEESSSSSSSSS! w00t!
SE works! I tested him. I just need to add extra dialogue, a game end situation I forgot about, and something to keep people from playing themselves, or maybe I should leave that in. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 1:34 pm Post subject: 11 |
|
|
| Testing now open. Download AIM from http://www.aol.com if you haven't already and click the iChat button at the top right of this page to help test. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 1:41 pm Post subject: 12 |
|
|
| nm, I have to add two more end game situations. You think I could leave those out, and let it come down to having one fire at the other, but I'm too lazy to program something to keep people from firing if they have no missiles, shielding if they have no shields, etc. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 1:54 pm Post subject: 13 |
|
|
| Testing reopened. I just beat Ryoushi at the first starship game modded by SE. Beat him on first move too. Both to nothing. |
|
| Back to top |
|
 |
JDTAY
obseletes now
|
Posted: Sun Oct 07, 2001 10:26 pm Post subject: 14 |
|
|
| SE mods ninja now too! I beat Chuck in the first ninja game modded by SE 0 to -2. |
|
| Back to top |
|
 |
|