User Friendly

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

See EvilGeniusesInaNutshell and TheRootOfAllEvil.

Interview with cast on ORA 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

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]

 Is it blue?
 Is it bigger than a breadbox?
 Is it smaller than a breadbox?
 Does it go "wiki-wiki-wiki"?

Couldn't resist writing it in 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


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