Discussion On
How to Write Original Jokes (Or Have A Computer Do It For You)

by in Fun Projects

27 Comments

  1. inspired12
    Sunday, March 214, 2008

    Dude this is really awesome. great job man. As a philosophy and psychology student I tip my hat at concept and execution. this is surely a step up from insult generators.

    Reply
  2. Manpreet Singh
    Sunday, March 3030, 2008

    Nice Unique Post… Keep It Up

    Reply
  3. dale
    Thursday, April 341, 2008

    Jess,
    Eliza was the interactive therapist script developed at Berkley too. I have tinkered with Eliza in the past and had her talking like a Native American Shaman at one stage ;-) Do you reckon we could get this to work within the old Eliza concept?

    Reply
  4. Jess Johnson
    Thursday, April 335, 2008

    @dale That is making me wonderer what a kind of advice a Native American psychologist Shaman would give me :) It would be a great addition to the Sweet Hacks series if you still have the code hanging around somewhere. Not sure how well the joke generator would mesh with Eliza, but it does get me wondering what would happen if Eliza and the joke generator were to talk to each other…

    Reply
  5. Clint
    Wednesday, April 903, 2008

    Did you hear that Tyson Chicken, a big supporter of the Clinton family, is now selling a package of Chicken in honor of Hillary?

    It has two fat legs, small breasts, and three left wings!

    Reply
  6. Jordan
    Wednesday, April 935, 2008

    I’m interested in language based programming projects but have not done any of my own. I’d like to do some similar linguistic programming experiments. Is there a specific reason you chose to write this in Common Lisp, or is it just the language you know?

    Reply
  7. Jess Johnson
    Wednesday, April 956, 2008

    @Jordan At the time, it was one of the 3 or so languages that I was using pretty regularly, so that did factor into it. Lisp dialects tend to be very popular for AI applications, because there is little distinction between code and data. The joke generator could have been written in any language, but in the end I think Common Lisp was a good choice.

    Reply
  8. Jordan
    Wednesday, April 952, 2008

    Thanks for posting this, I like it a lot. Thanks to this article and http://gigamonkeys.com/book/ I can start a new cubicle hobby.

    Reply
  9. Me
    Wednesday, April 905, 2008

    “Over Machu Pichu?” “I’ll never be over Machu Pichu.”

    Good job. It occured to me a while ago that you could write a program that goes through a script looking for words that were homonyms and dual-meanings to find puns to add jokes in. Considering the crap on TV, this could be a great program for hollywood.

    Reply
  10. Claus Brod
    Sunday, April 1312, 2008

    Great stuff!

    Trying to run the code in CLISP, I get an error message saying that make-hash-table is called with an illegal :TEST argument (STRING-EQUAL). And indeed, the standard says that MAKE-HASH-TABLE allows only eq, eql, equal and equalp as test functions 8-( So maybe this is an Allegro-specific extension?

    Claus

    Reply
  11. Jess Johnson
    Tuesday, April 1530, 2008

    @Claus I believe it is an Allegro specific function. The trial version of Allegro is free (as in beer) if you want to grab that.

    If anyone does a port to CLISP I would like to put it up on this page (with attribution to whoever made the port of course).

    Reply
  12. Aaron
    Wednesday, June 1843, 2008

    “More complete phonetic information. Some transformations rely on substitutions made by partial homophones. For example “mew” (the noise a cat makes) is phonetically similar to the “mu” in music, but it different from the “mu” in murderer. There is currently no way to express this difference.”

    One way to express the difference between different syllabic phonetics is to include in the database of each word the IPA pronunciation. You may not be able to do exact IPA, but it shouldn’t be hard to modify it slightly so the program can recognize the differences. Of course, this requires more work, but it’s just an idea.

    -Aaron

    Reply
  13. Alex
    Tuesday, August 522, 2008

    As someone with limited knowledge on the subject, or, someone who got a C in 9th grade Intro to Computer Science, I have to say, this is pretty awesome. Even though some of the jokes are ridiculous. I dig it.

    Reply
  14. Hex22
    Saturday, August 2336, 2008

    A marvellous idea!
    There’s only one small difficulty: could anyone explain how to run this in Allegro to a poor guy who had never seen a line of Lisp in his lifetime?
    So far I’ve only managed to run it with GENERATE as an init-function, but I couldn’t get further.

    Reply
  15. Tom
    Thursday, August 2804, 2008

    That’s a Pretty original idea. It goes beyond the random word hacking that gets put together for random name generators. Great job!

    Explore, Learn, Review: (programming languages)
    http://www.codesplunk.com

    Reply
  16. lisp lover
    Thursday, September 408, 2008

    i love lisp.

    Reply
  17. Archbotmaster
    Thursday, September 1116, 2008

    I tweaked the Lisp code to output AIML so that the jokes can be included in chat bots like A.L.I.C.E.:

    http://alicebot.blogspot.com/2008/09/some-new-aiml-jokes.html

    Reply
  18. Jess Johnson
    Thursday, September 1125, 2008

    @Archbotmaster Neat idea! Thanks for taking the time to tweak the code. It would be neat to see the joke generator folded into chat bots.

    Reply
  19. scott
    Friday, September 1224, 2008

    I actually lol’d quite hard at the sour balls joke.

    Nice work on that project, very interesting.

    Reply
  20. George Petsagourakis
    Monday, September 2927, 2008

    In LISP? Come one,… give Lua a try (www.lua.org) just to get your self little bit more freedom

    Reply
  21. Frank Carr
    Sunday, January 456, 2009

    I’ve been playing around with concepts like this for a while and it’s often entertaining what a rules engine can come up with with the right data. in my Blog Content Wizard program one of the biggest challenges I’ve found deals with improving the scope of relationships to make the resulting text more intelligible. I’ve found that throwing more data at the problem seems to help though.

    Reply
  22. Rajj
    Friday, October 255, 2009

    wow the coding seems quite complex, but i liked the concept of joke generation.. Nice post

    Reply
  23. Rainer Joswig
    Wednesday, December 1602, 2009

    I have changed the code slightly so that it is portable Common Lisp:

    new-jokes.lisp

    Reply
  24. John Fremlin
    Monday, December 2125, 2009

    Seems I have done the same as Rainer :-) — a modified version that works on SBCL.
    Thanks for light relief!

    WHAT DO YOU GET WHEN YOU CROSS A ROAD WITH A STRAWBERRY?
    traffic jam

    Reply
  25. Smug Weenie
    Thursday, November 2513, 2010

    George Pesta … whathisface wrote:

    “In LISP? Come one,… give Lua a try (www.lua.org) just to get your self little bit more freedom”

    Being locked to a badly optmized, crappy one-implementation imitation of Lisp is freedom?

    Common Lisp is awesome. Code-is-data, object orientation, native code compilation. Lua cannot hold a candle to Lisp.

    Lua is just someone’s C programming project. Common Lisp is an ANSI language with numerous impelmentations, some of which are newer and some decades mature.

    When you’re done wiping that retarded drool off your chin, you might want to learn that Lisp has not been spelled LISP since around 1980, “yourself” is one word, and “come on” not “come one”.

    Reply
  26. Thiago
    Friday, December 1007, 2010

    “WHAT DO YOU GET WHEN YOU CROSS A POPPY WITH ELECTRICITY?
    flower power”

    Jajajajajaja!. Amazing program! and thanks for writing it in the most beatiful programming language ever!. Congrats to you man!.

    Reply
  27. CL1
    Tuesday, April 2628, 2011

    I don’t get it LOL

    what do you get when you cross algae with a paper bag

    scum bag

    Reply

Leave a Reply