home *** CD-ROM | disk | FTP | other *** search
/ ftp.eterna.com.au / 2014.06.ftp.eterna.com.au.tar / ftp.eterna.com.au / lisp / shop.el < prev    next >
Text File  |  1997-02-08  |  24KB  |  429 lines

  1. ;;; shop.el --- generate random shopping lists
  2.  
  3. ;; Copyright (C) 1997 Noah S. Friedman
  4.  
  5. ;; Author: Noah Friedman <friedman@prep.ai.mit.edu>
  6. ;; Maintainer: friedman@prep.ai.mit.edu
  7. ;; Keywords: games
  8. ;; Created: 1997-02-04
  9.  
  10. ;; $Id: shop.el,v 1.2 1997/02/04 19:15:48 friedman Exp $
  11.  
  12. ;; This program is free software; you can redistribute it and/or modify
  13. ;; it under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation; either version 2, or (at your option)
  15. ;; any later version.
  16. ;;
  17. ;; This program is distributed in the hope that it will be useful,
  18. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. ;; GNU General Public License for more details.
  21. ;;
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with this program; if not, you can either send email to this
  24. ;; program's maintainer or write to: The Free Software Foundation,
  25. ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
  26.  
  27. ;;; Commentary:
  28.  
  29. ;; This program is a reimplementation of a hack written by Brian Rice in C
  30. ;; while he was a student at Oberlin College, c. 1989.  My silly-mail.el
  31. ;; program used to run that program and insert the output in mail headers.
  32. ;; Now I can do it purely in elisp.  Cons me harder!
  33.  
  34. ;;; Code:
  35.  
  36.  
  37. (defconst shop-adjectives
  38.   '["Arab-Israeli" "Arctic" "Asiatic" "Atlantic" "Baltic" "Braille"
  39.     "Buy & Break" "Byronic" "Catholic" "Celtic" "Cenozoic" "Chinese"
  40.     "Cretaceous" "Dad & Lad" "Dan Rather" "E-Z-Grip" "Gaelic" "Icelandic"
  41.     "Johnny-come-lately" "Maoist" "Marxist" "Mesozoic" "Mexican" "Miltonic"
  42.     "Mix 'n' Match" "Mrs. Leland's" "Napoleonic" "Naugahyde" "No-action"
  43.     "Olympic" "Poppin-Fresh" "Portuguese" "Prenatal" "Puddle-Off!"
  44.     "Reddy-Mix" "Ripe 'n' Sweet" "Samsonite" "Scratch 'n' Snot"
  45.     "Strike & Spare" "Teutonic" "Wax & Wear" "aberrant" "abhorrent"
  46.     "abrupt" "absent" "absorbent" "abstinent" "abundant" "academic"
  47.     "achievement-oriented" "acidic" "acoustic" "acrobatic" "adamant"
  48.     "adolescent" "adulterous" "advantageous" "adventurous" "aerobic"
  49.     "aerodynamic" "aeronautical" "aesthetic" "affluent" "agnostic"
  50.     "air-conditioned" "alcoholic" "algebraic" "allegorical" "allergic"
  51.     "alphabetic" "amber" "ambidextrous" "ambient" "ambiguous" "ambitious"
  52.     "ambivalent" "amorphous" "amphibious" "amusing" "anachronistic"
  53.     "anaerobic" "analytical" "anarchic" "anatomic" "ancient" "androgynous"
  54.     "angelic" "anomalous" "anonymous" "antagonistic" "anthropomorphic"
  55.     "antic" "antiperspirant" "anxious" "apathetic" "apocalyptic"
  56.     "apologetic" "aquatic" "archaic" "ardent" "arduous" "aristocratic"
  57.     "aromatic" "arrogant" "ascetic" "assiduous" "astigmatic"
  58.     "astronautical" "astronomical" "asymmetrical" "asynchronous" "athletic"
  59.     "atmospheric" "atomic" "atrocious" "atypical" "audacious" "auspicious"
  60.     "authentic" "autistic" "autocratic" "automated" "automatic"
  61.     "automotive" "autonomous" "avaricious" "awkward" "axiomatic" "barbaric"
  62.     "barbarous" "barking" "barometric" "basic" "beatific" "beauteous"
  63.     "belligerent" "benevolent" "bent" "bestial" "bicentennial" "big"
  64.     "biochemical" "blasphemous" "blatant" "bloated" "blunt" "boisterous"
  65.     "bombastic" "boring" "botanical" "bouffant" "bucolic" "bumptious"
  66.     "buoyant" "bureaucratic" "burnt" "burrowing" "cackling" "cadaverous"
  67.     "cagey" "calamitous" "callous" "cancerous" "capacious" "capricious"
  68.     "capsized" "carbonated" "carcinogenic" "cataclysmic" "catalytic"
  69.     "catastrophic" "catatonic" "categorical" "caustic" "cautious"
  70.     "cavernous" "celebrity" "ceramic" "ceremonious" "cervical" "chaotic"
  71.     "characteristic" "charismatic" "cheesy" "chemical" "chic" "chimerical"
  72.     "chivalrous" "chromatic" "chronic" "cinematic" "circuitous" "circular"
  73.     "civic" "civil" "clairvoyant" "classic" "classical" "claustrophobic"
  74.     "clerical" "climactic" "clinical" "cogent" "cognizant" "coherent"
  75.     "comical" "commodious" "communal" "competent" "complacent"
  76.     "complaisant" "compliant" "concentric" "concomitant" "concurrent"
  77.     "condo-conscious" "confusing" "conical" "coniferous" "conscientious"
  78.     "conscious" "consistent" "conspicuous" "constant" "contagious"
  79.     "contemptuous" "continuous" "convalescent" "convenient" "cooking"
  80.     "copious" "corpulent" "cosmetic" "cosmic" "coughing" "courageous"
  81.     "courteous" "credulous" "cretinous" "critical" "cryogenic" "cryptic"
  82.     "cubical" "curious" "curvaceous" "cylindrical" "cynical" "dangerous"
  83.     "dark" "deboned" "decadent" "decorator" "deep-fried" "defiant"
  84.     "deficient" "delicious" "delinquent" "delirious" "democratic"
  85.     "demonic" "deodorant" "deoxyribonucleic" "dependent" "despondent"
  86.     "despotic" "detrimental" "deviant" "devious" "dexterous" "diabetic"
  87.     "diabolical" "diagnostic" "diaphanous" "dicey" "didactic" "dietetic"
  88.     "different" "diffident" "diligent" "diplomatic" "disastrous"
  89.     "disheveled" "disorienting" "dissident" "dissonant" "distant"
  90.     "distracted" "dogmatic" "domestic" "dormant" "dramatic" "drastic"
  91.     "dubious" "dynamic" "dynastic" "dyno-blast" "dysfunctional"
  92.     "dyspeptic" "ebullient" "eccentric" "ecclesiastical" "eclectic"
  93.     "economical" "ecstatic" "educated" "efficient" "egocentric"
  94.     "egregious" "elastic" "electric" "electronic" "elegant" "elevated"
  95.     "elliptical" "eloquent" "embryonic" "eminent" "emphatic" "enchained"
  96.     "enchanted" "encyclopedic" "energetic" "enigmatic" "enormous"
  97.     "enthusiastic" "envious" "epic" "epileptic" "erotic" "errant"
  98.     "erratic" "erroneous" "esoteric" "ethical" "eugenic" "euphoric"
  99.     "evangelical" "excellent" "exorbitant" "exotic" "expandable"
  100.     "expectant" "expeditious" "experimental" "extemporaneous"
  101.     "extracurricular" "extraneous" "extravagant" "exuberant" "fabulous"
  102.     "facetious" "fallacious" "famous" "fanatical" "fancy" "fantastic"
  103.     "fastidious" "fat" "fatuous" "felicitous" "felonious" "fencing"
  104.     "fermented" "ferocious" "fervent" "fibrous" "fictitious" "flagrant"
  105.     "flamboyant" "flammable" "flatulent" "flippant" "flirtatious" "fluent"
  106.     "fluorescent" "flying" "forensic" "fragrant" "frantic" "fraudulent"
  107.     "frenetic" "fresh-frozen" "frilly" "frivolous" "frothy"
  108.     "fuel-injected" "furious" "galactic" "gallant" "garden-variety"
  109.     "garrulous" "gaseous" "gaunt" "gelatinous" "generic" "generous"
  110.     "geopolitical" "geriatric" "giant" "gigantic" "glamorous" "gloating"
  111.     "global" "glorious" "golden" "gorgeous" "gracious" "grammatical"
  112.     "grandiloquent" "graphic" "gratuitous" "gregarious" "grievous"
  113.     "gripping" "groundless" "gubernatorial" "gymnastic" "handy"
  114.     "hard-core" "hardy" "harmonic" "harmonious" "harried" "hasty"
  115.     "hazardous" "hectic" "helium-sucking" "hemispherical" "heretical"
  116.     "heroic" "hesitant" "heterogeneous" "hideous" "hierarchical"
  117.     "hieroglyphic" "hilarious" "historic" "histrionic" "hobnobbing"
  118.     "homestyle" "homogeneous" "horn-rimmed" "horrendous" "hot" "hot pink"
  119.     "humiliated" "humorous" "hurtling" "hydraulic" "hydroelectric"
  120.     "hyperbolical" "hypnotic" "hypocritical" "hypothetical" "hysterical"
  121.     "idiosyncratic" "idiotic" "idyllic" "igneous" "ignominious" "ignorant"
  122.     "illogical" "illustrious" "impatient" "imperious" "impertinent"
  123.     "impervious" "impetuous" "impious" "important" "imported" "impotent"
  124.     "impractical" "imprudent" "impudent" "inadvertent" "inauspicious"
  125.     "incandescent" "incautious" "incessant" "incestuous" "inclement"
  126.     "incoherent" "incompetent" "incongruous" "inconsistent"
  127.     "inconspicuous" "inconstant" "inconvenient" "incredulous" "incumbent"
  128.     "indecent" "independent" "indifferent" "indigenous" "indigent"
  129.     "indignant" "indolent" "indulgent" "industrious" "inefficient"
  130.     "inelastic" "inelegant" "infamous" "infant" "infectious" "ingenious"
  131.     "ingenuous" "inglorious" "inharmonious" "iniquitous" "injudicious"
  132.     "injured" "injurious" "innocent" "inorganic" "inquisitive" "insidious"
  133.     "insignificant" "insipid" "insistent" "insolent" "insouciant"
  134.     "instant" "instantaneous" "insufficient" "intelligent" "intergalactic"
  135.     "interlocking" "intermittent" "intolerant" "intoxicating"
  136.     "intransigent" "intravenous" "intrinsic" "introductory" "intrusive"
  137.     "inundated" "invidious" "ironic" "irrelevant" "irreverent"
  138.     "irritating" "jealous" "jellied" "joyous" "jubilant" "judicious"
  139.     "juvenile" "labio-palatal" "laborious" "lackadaisical" "lascivious"
  140.     "latent" "left-handed" "lenient" "lesser-known" "libelous"
  141.     "libidinous" "licentious" "lightweight" "lily-livered" "lingering"
  142.     "linty" "liquid-center" "litigious" "logical" "long-playing"
  143.     "loquacious" "lousy" "lubricating" "lubricious" "lucky" "ludicrous"
  144.     "luminescent" "luminous" "lunar" "lunatic" "luscious" "lustrous"
  145.     "luxuriant" "luxurious" "lyrical" "magical" "magisterial"
  146.     "magnanimous" "magnetic" "magnificent" "majestic" "malcontent"
  147.     "malevolent" "malicious" "malignant" "maniacal" "marvelous"
  148.     "maternity" "mathematical" "mauve" "mechanical" "medical" "melodic"
  149.     "melodious" "melodramatic" "mendacious" "menstruating" "meretricious"
  150.     "meritorious" "metallic" "metaphorical" "meteoritic" "methodical"
  151.     "meticulous" "metric" "midget" "mighty" "migrant" "militant"
  152.     "miraculous" "misanthropic" "miscellaneous" "mischievous"
  153.     "misdirected" "missing" "momentous" "monarchical" "monogamous"
  154.     "monotonous" "monstrous" "mountainous" "multitudinous" "murderous"
  155.     "muscular" "musical" "mutant" "myopic" "mysterious" "mystic"
  156.     "mythical" "nebulous" "negligent" "neoclassical" "nervous" "neurotic"
  157.     "nice" "non-reloading" "nonchalant" "nonsensical" "nostalgic" "nosy"
  158.     "notorious" "noxious" "nuclear" "numerical" "numerous" "nutritious"
  159.     "nylon" "obedient" "oblivious" "obnoxious" "obsequious" "observant"
  160.     "obsolescent" "obvious" "odious" "odorous" "officious" "oligarchical"
  161.     "ominous" "omnipotent" "omnipresent" "omniscient" "onerous"
  162.     "optimistic" "opulent" "oratorical" "organic" "orgiastic" "ornery"
  163.     "orthodontic" "ostentatious" "outrageous" "paradoxical" "parasitic"
  164.     "parenthetical" "parliamentary" "parsimonious" "partial" "pasty-faced"
  165.     "pathetic" "patriotic" "pedantic" "pelvic" "pendulous" "penile"
  166.     "peppermint" "perfidious" "perilous" "periodical" "permanent"
  167.     "pernicious" "persistent" "perspicacious" "persuasive" "petrified"
  168.     "petulant" "pharmaceutical" "philanthropic" "philosophical"
  169.     "phosphorescent" "photogenic" "physical" "pink" "pious" "piteous"
  170.     "planetary" "plastic" "platonic" "pleasant" "pleasing" "pliant"
  171.     "pneumatic" "poetic" "poignant" "poisonous" "polemical" "political"
  172.     "polyandrous" "polygynous" "pompous" "ponderous" "populous" "porous"
  173.     "portentous" "postdoctoral" "posthumous" "pragmatic" "precarious"
  174.     "precious" "precocious" "pregnant" "prehistoric" "preposterous"
  175.     "presidential" "prestigious" "presumptuous" "pretentious" "prevalent"
  176.     "previous" "problematic" "prodigious" "proficient" "prolific"
  177.     "prominent" "promiscuous" "prophetic" "propitious" "prosaic"
  178.     "prosperous" "prosthetic" "prototypical" "prudent" "prurient"
  179.     "psychiatric" "psychic" "psychotic" "pubescent" "public" "puerile"
  180.     "pulmonary" "pulsing" "pungent" "puritanical" "pyrotechnical" "quaint"
  181.     "quaking" "querulous" "quixotic" "quizzical" "radiant" "radioactive"
  182.     "rain-making" "rampant" "rancorous" "rapacious" "raucous" "ravenous"
  183.     "rebellious" "recalcitrant" "recoilless" "recreational" "recurrent"
  184.     "red-winged" "redundant" "regimented" "relevant" "religious"
  185.     "reluctant" "reminiscent" "remote" "repellent" "repentant"
  186.     "repetitious" "repressed" "repugnant" "resentful" "resilient"
  187.     "resonant" "respectable" "resplendent" "responsible" "resurgent"
  188.     "reticent" "reverent" "revised" "rhapsodical" "rhetorical" "rheumatic"
  189.     "rhythmic" "ridiculous" "righteous" "rigorous" "riotous" "risque"
  190.     "river-toweling" "romantic" "rudimentary" "ruinous" "ruminant"
  191.     "ruminating" "runcible" "rustic" "sacrilegious" "sagacious"
  192.     "salacious" "salubrious" "sanctimonious" "sarcastic" "sardonic"
  193.     "satanic" "satirical" "savage" "scandalous" "scanty" "scary" "scenic"
  194.     "scented" "schizophrenic" "scholastic" "scientific" "scornful"
  195.     "scrumptious" "scrupulous" "scurrilous" "secret" "seditious" "seismic"
  196.     "self-propelled" "sensual" "sensuous" "sentimental" "serendipitous"
  197.     "serious" "sexy" "shallow" "significant" "silent" "simplistic"
  198.     "simultaneous" "sinuous" "skeptical" "skid-proof" "slanderous"
  199.     "slanty-wise" "so-called" "solar-frightened" "solicitous" "sonorous"
  200.     "sophomoric" "space" "spacious" "spastic" "spearmint" "special"
  201.     "specious" "spherical" "spontaneous" "sporadic" "spurious" "squinty"
  202.     "stagnant" "starboard" "state-supported" "static" "sticky"
  203.     "stimulating" "stoic" "strategic" "strenuous" "studious" "stupendous"
  204.     "subatomic" "subservient" "sudsing" "sulfurous" "sullen" "sumptuous"
  205.     "sunburnt" "supercilious" "superfluous" "superstitious" "surfing"
  206.     "surreptitious" "suspicious" "symbiotic" "symbolical" "symmetrical"
  207.     "sympathetic" "symphonic" "syncopated" "synonymous" "tabular"
  208.     "talented" "tedious" "telepathic" "televised" "tempestuous"
  209.     "tenacious" "tenuous" "terrific" "therapeutic" "thieving" "throwaway"
  210.     "thunderous" "titanic" "tolerant" "topical" "torrential" "tortuous"
  211.     "toxic" "tragic" "tragicomical" "traitorous" "trans-Atlantic"
  212.     "transient" "translucent" "transoceanic" "transparent" "transplanted"
  213.     "traumatic" "treacherous" "treasonous" "tremendous" "tremulous"
  214.     "trenchant" "triumphant" "tropical" "tumultuous" "turbulent" "two-way"
  215.     "typical" "tyrannical" "ubiquitous" "unanimous" "unforgivable"
  216.     "unhappy" "uninteresting" "unopened" "unreliable" "uproarious"
  217.     "urgent" "vacant" "vacationing" "vacuous" "vainglorious" "valiant"
  218.     "various" "vehement" "venomous" "vibrant" "vicarious" "vicious"
  219.     "victorious" "vigilant" "vigorous" "villainous" "violent" "virtuous"
  220.     "virulent" "viscous" "vitriolic" "vivacious" "vociferous" "volcanic"
  221.     "voluminous" "voluptuous" "voracious" "watery" "weary" "welding" "wet"
  222.     "whimsical" "wine-making" "winged" "wishy-washy" "wondrous" "would-be"
  223.     "wry" "zealous"])
  224.  
  225. (defconst shop-nouns
  226.   '[["Budweiser" "buds"] ["Garden Weasel"]
  227.     ["Johnny Carson" "Johnny Carson lookalikes"] "L'eggs" ["ablution"]
  228.     ["abolition" "abolitionists"] ["abrasion" "bruisers"]
  229.     ["absorption" "absorbers"] ["abstention" "tee-totallers"]
  230.     ["accordion"] ["accusation" "accusers"] "acne" ["adhesive"]
  231.     ["admonition" "admonishers"] ["aggression" "aggressors"] "aluminum"
  232.     "ambition" "ammunition" ["animal"] ["annoyer"] ["ant"] ["apparition"]
  233.     "approval" ["argumentation" "arguments"] ["artery" ies -1] ["ash" es]
  234.     ["aspersion"] ["assumption"] "attention" ["auction"] ["audition"]
  235.     ["ax" es] "bacon" ["bag lunch" es] ["bag"] ["ball"] ["basket"]
  236.     ["battalion"] ["beagle"] ["bear"] ["bee"] "beef" ["benediction"]
  237.     ["bird"] ["bog"] ["bomb" "defusers"] ["bracelet"] "bread" "breath"
  238.     ["breeze"] ["bride"] ["brief"] "brunch" ["bug"] ["bum"] ["burger"]
  239.     ["button"] "cancer" ["capture" "captors"] ["card"] ["carnation"]
  240.     "carrion" ["casino"] "caution" ["cave"] ["chain"] ["champion"]
  241.     ["chase" rs] ["cheese"] "chocolate" "chowder" ["circumcision"]
  242.     ["circumlocution"] ["citation"] ["clasp"] ["climate"]
  243.     ["clothing" "clothes"] ["collision" "colliders"] ["collision"]
  244.     "combustion" ["commander"] ["commendation"] ["commission"]
  245.     ["commotion"] ["communion"] ["companion"] ["compass" es] "compassion"
  246.     ["competition" "competitors"] ["complex" "complicators"]
  247.     ["component" "ingredients"] ["compression" "compressors"]
  248.     ["compulsion"] ["concussion"] ["condensation" "condensers"]
  249.     ["condiment"] ["confession"] ["configuration"]
  250.     ["confirmation" "confirmers"] ["confrontation"] "confusion"
  251.     "congestion" ["connotation"] "consolation" ["console"]
  252.     ["consumption" "consumers"] ["contraception" "contraceptives"]
  253.     ["contraption"] ["contribution"] ["convulsion"] ["coolant"]
  254.     "corruption" ["cotillion"] ["cow"] ["crossword"] ["cushion"]
  255.     ["dandelion"] "deception" ["delusion"] "demolition" ["departure"]
  256.     ["depression"] ["derision" "deriders"] ["destroyer"]
  257.     ["detection" "detectors"] "detention" ["detergent"] ["devotion"]
  258.     "dice" ["digression"] ["direction"] "dirt" ["distemper" "distenders"]
  259.     ["distinguisher"] ["division" "dividers"] ["dock"] ["document"]
  260.     ["dog"] ["dogboy"] ["dwarf" "dwarves"] "ecstasy" ["effluent"] ["egg"]
  261.     ["eggplant"] ["emission"] ["emotion"] ["enema"] "erosion" ["eruption"]
  262.     ["excitement"] ["exclamation"] ["exclusion"] ["exhibition"]
  263.     ["expectation"] ["expectorant"] ["explosion"] ["expulsion"]
  264.     ["face" ers] ["fashion"] "fiction" ["finger"] "fission" ["flake"]
  265.     ["flossbag"] ["flotation" "floats"] "food" "friction" "friction"
  266.     ["frivolity" "cheater-hawks"] "fruit" "furniture" ["ghost-melt"]
  267.     ["glove"] ["goat"] ["goiter" "fads"] "gold" ["gong"] ["goose" "geese"]
  268.     "gravy" ["griddle"] "grief" "guilt" "gumption" "hair" ["hamster-lip"]
  269.     ["hand"] ["harmony" "harmonizers"] "hatred" "hay" ["helmet"] ["hider"]
  270.     ["holiday"] "honey" ["honk" ers] ["hootenanny" ies -1] "horsie"
  271.     ["hydrant"] ["ignition"] ["illusion"] ["immunization"] ["import"]
  272.     ["imposition"] ["incantation"] "indigestion" ["infestation"]
  273.     ["inflammation"] ["inhibition"] "ink" ["inquisition"] ["insect"]
  274.     ["insurgent"] ["interruption"] ["intrusion"] ["invasion"]
  275.     ["inversion"] ["itinerant"] ["jungle"] ["ladder"] ["laser"] "laughter"
  276.     ["laxative"] ["lesion"] ["lieutenant"] ["lion"] ["lip"] ["liver"]
  277.     ["load"] ["lobotomy" ies -1] ["log"] ["longitude"] ["loser"] "lotion"
  278.     ["lozenge"] ["lunchbox" "bits"] "malnutrition" ["melon"] ["metronome"]
  279.     ["minion"] ["miscreant"] ["mispronunciation"] "money" ["monkey"]
  280.     ["mound"] ["mountain"] ["mouse" "mice"] ["neglect" ers]
  281.     ["nostril" "doodads"] "nougat" "nutrition" "oblivion" ["obsession"]
  282.     ["ointment"] ["omission"] ["onion"] ["opinion"] ["organ"]
  283.     ["pageantry" ies -1] ["pajama"] ["pancake"] ["paradox" es]
  284.     ["party" ies -1] "passion" ["pencil"] ["penny" ies -1] ["perplexer"]
  285.     ["persecution" "persecuters"] "perspiration"
  286.     ["persuasion" "persuaders"] ["perversion"] ["piano"] ["picnic"]
  287.     ["pig"] ["pincushion"] ["piston"] ["pollution" "polluters"] ["pond"]
  288.     "porno" ["potion"] ["prescription"] "preserves"
  289.     ["pretense" "pretenders"] ["proclamation"] ["promotion"]
  290.     ["pronunciation"] ["proportion"] ["proposition"]
  291.     ["prosecution" "prosecutors"] ["prostitution" "prostitutes"]
  292.     ["protein"] ["protrusion"] ["puppy" ies -1] "putty" ["rail"] "rain"
  293.     ["raisin"] ["rebellion"] ["rectum"] ["redeemer"] ["reinforcement"]
  294.     ["relaxation" "relaxers"] ["remainder"] ["removal" "removers"]
  295.     "rendezvous" ["reservation"] ["retardation" "retarders"]
  296.     ["retention" "retentives"] ["retraction" "rectractors"]
  297.     ["retribution"] "revulsion" "rice" ["ring"] ["riot"] ["ripping-cat"]
  298.     ["robber"] ["rodent"] ["rooster"] ["rotation" "rotators"]
  299.     ["royalty" ies -1] "rubber" ["salad"] "salmon" ["sample"] "sand"
  300.     ["sandwich" es] "sauce" ["scenario"] ["scorpion"] ["secretion"]
  301.     ["seduction" "seducers"] ["selector"] ["shoe"] ["shrub" bery] ["ski"]
  302.     ["sleeve"] ["snooze" ers] ["snore" "ignorers"] ["snowbulb"] ["sock"]
  303.     "sodium" ["sofa"] "soft-serve" "soil" ["split"] ["squeeze" "checks"]
  304.     ["squirrel"] ["stone"] "string-art" "suction" "sugar" ["suicide"]
  305.     ["surprise"] ["suspension" "suspenders"] ["suspicion"] ["swindler"]
  306.     ["sycophant"] ["table"] ["tampon"] "tape" ["televangelist"]
  307.     ["television"] ["temptation"] ["tension"] "thunder" ["tool" "pliers"]
  308.     ["toothpick"] ["translation" "translators"] "trash" "travesty"
  309.     ["treaty" ies -1] "trout" ["turkey"] ["unit"] ["vagrant"] "vapor"
  310.     ["warrior"] ["watch" "watchers"] ["wavechord"] ["welt"] ["whip"]
  311.     ["wig"] ["will-o'-the-wisp"] ["winch" es] ["wind"] "wine" ["winter"]
  312.     ["witch" es] ["yarn"]])
  313.  
  314.  
  315. (defmacro shop-random (n)
  316.   (list '% '(abs (random)) n))
  317.  
  318. (defun shop-random-adjective ()
  319.   (aref shop-adjectives (shop-random (length shop-adjectives))))
  320.  
  321. (defun shop-random-noun ()
  322.   (let ((entry (aref shop-nouns (shop-random (length shop-nouns)))))
  323.     (if (vectorp entry)
  324.         (aref entry 0)
  325.       entry)))
  326.  
  327. (defun shop-random-plural ()
  328.   (let ((entry (aref shop-nouns (shop-random (length shop-nouns)))))
  329.     (cond ((stringp entry)
  330.            entry)
  331.           ((= (length entry) 1)
  332.            (concat (aref entry 0) "s"))
  333.           ((= (length entry) 2)
  334.            (if (stringp (aref entry 1))
  335.                (aref entry 1)
  336.              (concat (aref entry 0)
  337.                      (symbol-name (aref entry 1)))))
  338.           ((= (length entry) 3)
  339.            (concat (substring (aref entry 0) (aref entry 2))
  340.                    (symbol-name (aref entry 1)))))))
  341.  
  342. (defun shop-string ()
  343.   (let ((noun-1 "")
  344.         (noun-2 "")
  345.         (adj-1 "")
  346.         (adj-2 "")
  347.         (n (shop-random 5)))
  348.     (and (>= n 3)
  349.          (setq noun-1 (shop-random-noun)))
  350.     (setq noun-2 (shop-random-plural))
  351.     (while (string= noun-2 noun-1)
  352.       (setq noun-2 (shop-random-plural)))
  353.  
  354.     (setq n (shop-random 4))
  355.     (and (= n 3)
  356.          (setq adj-1 (shop-random-adjective)))
  357.     (setq adj-2 (shop-random-adjective))
  358.     (while (string= adj-1 adj-2)
  359.       (setq adj-2 (shop-random-adjective)))
  360.  
  361.     (or (string= "" adj-1)  (setq adj-1  (concat adj-1  " ")))
  362.     (or (string= "" adj-2)  (setq adj-2  (concat adj-2  " ")))
  363.     (or (string= "" noun-1) (setq noun-1 (concat noun-1 " ")))
  364.  
  365.     (format "%s%s%s%s" adj-1 adj-2 noun-1 noun-2)))
  366.  
  367. (defun shop-string-list (&optional n)
  368.   (or n (setq n 3))
  369.   (and (< n 0)
  370.        (signal 'domain-error (list "Arg must be positive" n)))
  371.   (let ((l nil))
  372.     (while (not (zerop n))
  373.       (setq l (cons (shop-string) l))
  374.       (setq n (1- n)))
  375.     l))
  376.  
  377. (defun shop-capitalize-string (s &optional allp)
  378.   (setq s (copy-sequence s))   ; don't modify original
  379.   (let ((case-fold-search nil)
  380.         (pos 0)
  381.         (data (match-data)))
  382.     (while (and (< pos (length s))
  383.                 (string-match "\\<[a-z]" s pos))
  384.       (aset s (match-beginning 0)
  385.             (upcase (aref s (match-beginning 0))))
  386.       (if allp
  387.           (setq pos (match-end 0))
  388.         (setq pos (length s))))
  389.     (store-match-data data)
  390.     s))
  391.  
  392.  
  393. ;;;###autoload
  394. (defun shop (&optional prefix)
  395.   "Display a shopping list.
  396. Shop prints out a list of things you might want to pick up on
  397. your next trip to the five and dime.  By default, it suggests
  398. three items; with a numeric prefix arg, display that many items.
  399. With a negative prefix arg, don't number the items."
  400.   (interactive "P")
  401.   (cond ((null prefix)
  402.          (setq prefix 3))
  403.         ((consp prefix)
  404.          (setq prefix -3)))
  405.   (let ((l (shop-string-list (abs prefix)))
  406.         (n 1)
  407.         (countp (>= prefix 0)))
  408.     (with-output-to-temp-buffer "*Shopping List*"
  409.       (princ "Here is your shopping list:\n")
  410.       (while l
  411.         (if countp
  412.             (princ (format "(%d) %s\n" n (shop-capitalize-string (car l))))
  413.           (princ (car l))
  414.           (princ "\n"))
  415.         (setq n (1+ n))
  416.         (setq l (cdr l))))))
  417.  
  418. ;;;###autoload
  419. (defun shop-middle-name ()
  420.   "The Mark McAuliffe Honorary command."
  421.   (interactive)
  422.   (message "%s, your middle name is \"%s.\""
  423.            (user-full-name)
  424.            (shop-capitalize-string (shop-string) t)))
  425.  
  426. (provide 'shop)
  427.  
  428. ;;; shop.el ends here.
  429.