Cleaning Tiny Applications Collection, I’ve dropped both artificial intelligence scripts. Not wanting to let them disappear completely, I’m posting them here for posterity. The first one is an eight line of code version that might be what Sid wrote as his first ever program:
#!/usr/bin/perl -wWtT
while (<>) {
if (/[aeiouyAEIOUY][^a-zA-Z]*$/) {
print "Yes.\n";
} elsif (!/^\s*$/) {
print "No.\n";
}
}
UserFriendlsy comic strip for 2000-10-14 in which Sid describes his eight-line AI program.
The second is a six-line version akin to Pitr’s code:
UserFriendlsy comic strip for 1999-06-02 in which Pitr describes his six-line AI program.
Below is recreation of the scenes from the UserFriendly comic strips:
$ ./ai-sid.plIs it blue?
Yes.
Is it bigger than a breadbox?
No.
Is it smaller than a breadbox?
No.
Does it go wiki-wiki-wiki?
Yes.
^D
$ ./ai-pitr.plIs my name Mike Floyd?
Yes.
Very clever Pitr is, Da?
No!
^D
Interestingly, each version give opposite responses to the same question. Joining their standard inputs with standard outputs (as to make them talk with each other) does not yield interesting results.