The Grey Labyrinth is a collection of puzzles, riddles, mind games, paradoxes and other intellectually challenging diversions. Related topics: puzzle games, logic puzzles, lateral thinking puzzles, philosophy, mind benders, brain teasers, word problems, conundrums, 3d puzzles, spatial reasoning, intelligence tests, mathematical diversions, paradoxes, physics problems, reasoning, math, science.

   
The Grey Labyrinth Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister  
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SpinachEater

 
Reply to topic    The Grey Labyrinth Forum Index -> Visitor Submitted News
View previous topic :: View next topic  
Author Message
JDTAY
obseletes now



PostPosted: Sat Oct 06, 2001 2:35 pm    Post subject: 1 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sat Oct 06, 2001 3:13 pm    Post subject: 2 Reply with quote

http://chuckgaydos.homestead.com/files/starship.html

There's a link to the rules for starship.
Back to top
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sat Oct 06, 2001 3:24 pm    Post subject: 3 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
ChienFou
Leader of the pack



PostPosted: Sat Oct 06, 2001 3:38 pm    Post subject: 4 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
JDTAY
obseletes now



PostPosted: Sat Oct 06, 2001 5:07 pm    Post subject: 5 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sat Oct 06, 2001 5:25 pm    Post subject: 6 Reply with quote

Okay, no testing until I can get a hold of Hy.
Back to top
View user's profile Send private message Send e-mail AIM Address
Chuck
Daedalian Member



PostPosted: Sat Oct 06, 2001 5:31 pm    Post subject: 7 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
HyToFry
Drama queen



PostPosted: Sun Oct 07, 2001 7:14 am    Post subject: 8 Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 1:05 pm    Post subject: 9 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 1:19 pm    Post subject: 10 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 1:34 pm    Post subject: 11 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 1:41 pm    Post subject: 12 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 1:54 pm    Post subject: 13 Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
JDTAY
obseletes now



PostPosted: Sun Oct 07, 2001 10:26 pm    Post subject: 14 Reply with quote

SE mods ninja now too! I beat Chuck in the first ninja game modded by SE 0 to -2.
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous: by   
Reply to topic    The Grey Labyrinth Forum Index -> Visitor Submitted News All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Site Design by Wx3