User Friendly

http://www.userfriendly.org/

The following comic is discussed below: 2000-10-14

See EvilGeniusesInaNutshell and TheRootOfAllEvil.


Interview with cast on ORA http://www.oreilly.com/news/rootofevil_1001.html

oreilly.com: Pitr, can you tell us the recipe for the perfect cup of coffee?

Pitr: Time. Time and evaporation.

Might be fun to write a Pitr-bot....


Obviously he didn't start with Perl:

 #!/usr/bin/perl -p
 $_=(/([aeiouy])\W*$/i?$^T&1&&$1eq'y'?No:Yes:No).".\n"

This has a few changes from version 1.0. First of all, this version removes the obsolete input limit of only 20 questions. Also, who needs a prompt? Prompts are for the weaklings who can't remember what their commands do. Finally, since "y" is sometimes a vowel, it is considered a vowel if the script is started on an even second. (This has the advantage of making unit testing much more interesting.)

Sample session: [text in bold is user input]

 perl ai.pl
 Is it blue?
 Yes.
 Is it bigger than a breadbox?
 No.
 Is it smaller than a breadbox?
 No.
 Does it go "wiki-wiki-wiki"?
 Yes.


Couldn't resist writing it in python;

 #!/usr/bin/python
 while 1: print ('No', 'Yes')[bool(__import__('re').findall('[aeious]\W*$', raw_input()))]

Output as above.


Here's a better version without all that icky non-functional statefulnes.

  list( (lambda sys_,re_: sys_.stdout.write(('No.\n','Yes.\n')
  [int(bool(re_.findall('[aeious]\W*$', raw_input())))]))
  (__import__('sys'), __import__('re')) for x in 
  (lambda types: types.InstanceType?(types.ClassType?('inf',(), 
  {'next':lambda x: 1, '__iter__':lambda x: x})))(__import__('types')) )

-- IvanTkatchev

CategoryComicStrip


EditText of this page (last edited October 14, 2014) or FindPage with title or text search