Country & Western Song Maker

I wish that I'd kept the name of the person who wrote this, and the date that it was sent. It's a C-shell script (for UNIX systems, for those who don't know). Enjoy!
# I don't remember who wrote this for me, but hey, it's useful! Save to disk,
# chmod u+x CnWSongmaker, and execute it. (On Unix/Linux, of course...)
#!/bin/csh -f
echo "Today's Country 'n' Western song:"
goto vocab

start:

set randumblabel="zero"
set ranhigh=$#intro
goto randumb
zero:
echo " "
echo -n "$intro[$ranval],"

set randumblabel="one"
set ranhigh=$#where
goto randumb
one:
echo -n " I met her $where[$ranval]"

set randumblabel="two"
set ranhigh=$#how
goto randumb
two:
echo " $how[$ranval]."

set randumblabel="three"
set ranhigh=$#apparel
goto randumb
three:
echo "I can still recall $apparel[$ranval] she wore."

set randumblabel="four"
set ranhigh=$#doing
goto randumb
four:
echo -n "She was $doing[$ranval]"

set randumblabel="five"
set ranhigh=$#how2
goto randumb
five:
echo " $how2[$ranval],"

set randumblabel="six"
set ranhigh=$#whatiknew
goto randumb
six:
echo "Though I knew $whatiknew[$ranval]."

set randumblabel="seven"
set ranhigh=$#prefix
goto randumb
seven:
echo " "
echo -n "Then $prefix[$ranval],"

set randumblabel="eight"
set ranhigh=$#promise
goto randumb
eight:
echo " I'll $promise[$ranval] forever."

set randumblabel="nine"
set ranhigh=$#said
goto randumb
nine:
echo "She said to me $said[$ranval]."

set randumblabel="ten"
set ranhigh=$#did
goto randumb
ten:
echo -n "But who'd have thought she'd $did[$ranval]"

set randumblabel="eleven"
set ranhigh=$#how3
goto randumb
eleven:
echo " $how3[$ranval]?"

set randumblabel="twelve"
set ranhigh=$#bigfinish
goto randumb
twelve:
echo "$bigfinish[$ranval] goodbye."

echo " "
goto done

vocab:
# obviously, match the rhythm in anything you add.
set intro=( \
 "Well" \
 "Oh" \
 "Hey" \
 "Yes" \
 "Yeah" \
 "So" \
 "Now" \
 "Once" \
 )
set where=( \
 "in Sheboygan" \
 "outside Fresno" \
 "in New Orleans" \
 "near Atlanta" \
 "close to Macon" \
 "north of Tampa" \
 "west of Richmond" \
 "east of Memphis" \
 "south of Charlotte" \
 "outside Shreveport" \
 "far from Knoxville" \
 "next to Nashville" \
 "at a truck stop" \
 "on the highway" \
 "in a jail cell" \
 "in a treehouse" \
 "at the movies" \
 "at the ballgame" \
 "on the rooftop" \
 "at the grocers" \
 "in her trailer" \
 )
set how=(\
 "in September" \
 "at McDonald's" \
 "ridin' shotgun" \
 "wrestlin' gators" \
 "all hunched over" \
 "poppin' uppers" \
 "sort of pregnant" \
 "with some joggers" \
 "stoned on oatmeal" \
 "with Merv Griffin" \
 "dead all over" \
 "for a quickie" \
 "on probation" \
 "in a nightmare" \
 "incognito" \
 "in the Stone Age" \
 )
set apparel=( \
 "that purple dress" \
 "that little hat" \
 "that burlap bra" \
 "those training pants" \
 "the stolen goods" \
 "that plastic nose" \
 "the neon sign" \
 "that creepy smile" \
 "the hearing aid" \
 "the boxer shorts" \
 "the nose ring that" \
 "the toe ring that" \
 "the piercings that" \
 "the tattoo that" \
 "the panties that" \
 "the g-string that" \
 "the high heels that" \
 "the platform shoes" \
 "the clown shoes that" \
 "the black eye that" \
 "the make up that" \
 "the skunk perfume" \
 )
set doing=( \
 "sobbin' at the toll booth" \
 "drinkin' Dr. Pepper" \
 "weighted down with Twinkies" \
 "breakin' out with acne" \
 "crawlin' through the back yard" \
 "smellin' kind of funny" \
 "crashin' through the guardrail" \
 "chewin' on a hangnail" \
 "talkin' in Swahili" \
 "drownin' in the quicksand" \
 "slurpin' up linguini" \
 "makin' eyes at Lulu" \
 "speedin' in a school zone" \
 "trashin' up the hotel" \
 "hoppin' like a rabbit" \
 "kissin' Richard Nixon" \
 "testin' out her Uzi" \
 "milkin' her new Holstein" \
 "coachin' Michael Jordan" \
 "preachin' Jerry Falwell" \
 "eatin' salted pretzels" \
 "watchin' television" \
 )
set how2=( \
 "in the twilight" \
 "but I loved her" \
 "by the off-ramp" \
 "near Poughkeepsie" \
 "with her cobra" \
 "when she shot me" \
 "on her elbows" \
 "with Led Zeppelin" \
 "with Miss Piggy" \
 "in her muu-muu" \
 "with the hostess" \
 "just like mama" \
 "full of moonshine" \
 "with her cuzzin" \
 "next to Elvis" \
 "down the highway" \
 "on a sofa" \
 "with a midget" \
 "in a bathtub" \
 "and she knew it" \
 )
set whatiknew=( \
 "no guy would ever love her more" \
 "that she would be an easy score" \
 "she'd bought her dentures in a store" \
 "that she would be a crashing bore" \
 "I'd never rate her more than 4" \
 "they'd hate her guts in Baltimore" \
 "it was a raven, nothing more" \
 "we really lost the last World War" \
 "I'd have to scrape her off the floor" \
 "what strong deodorants were for" \
 "that she was rotten to the core" \
 "that I would upchuck on the floor" \
 "she'd see my needs as just a chore" \
 "that soon she'd mosey out the door" \
 "she was as boring as Al Gore" \
 "she'd sweat profusely from each pore"\
 "her face would make my spirit soar"\
 "her voice was like a lion's roar" \
 "her weight would make my muscles sore" \
 )
set prefix=( \
 "I promised her" \
 "I knew deep down" \
 "she asked me if" \
 "I told her shrink" \
 "the judge declared" \
 "my Pooh Bear said" \
 "I shrieked in pain" \
 "the painters knew" \
 "a Klingon said" \
 "my hamster thought" \
 "the blood test showed" \
 "her rabbi said" \
 "I left unsaid" \
 "my passion said" \
 "the warden guessed" \
 "the preacher prayed" \
 "she had to hope" \
 "I came to fear" \
 "the omens said" \
 "the gods declared" \
 "I had to think" \
 )
set promise=( \
 "stay with her" \
 "warp her mind" \
 "swear off booze" \
 "change my sex" \
 "punch her out" \
 "live off her" \
 "have my rash" \
 "stay a dwarf" \
 "walk her dog" \
 "pick my nose" \
 "play Go Fish" \
 "salivate" \
 "be a nerd" \
 "eat red meat" \
 "darn her socks" \
 "wash her feet" \
 "be her slave" \
 "play the sax" \
 "break her heart" \
 "play mind games" \
 "dance the Twist" \
 "wax the floor" \
 "wear these shorts" \
 "chew this gum" \
 "hold my breath" \
 )
set said=( \
 "our love would never die" \
 "there was no other guy" \
 "there was another guy" \
 "man wasn't meant to fly" \
 "that Nixon didn't lie" \
 "her basset hound was shy" \
 "that Rolaids made her high" \
 "she'd have a swiss on rye" \
 "she loved my one blue eye" \
 "her brother's name was Hy" \
 "she liked Spy vs. Spy" \
 "that birthdays made her cry" \
 "she couldn't stand my tie" \
 "for this yer gonna fry" \
 "she'd like an apple pie" \
 "my jokes were much too wry" \
 "Bruce Willis made her sigh" \
 "she thought my dad was sly" \
 "the limit was the sky" \
 "she thought that she could try" \
 "she knew no reason why" \
 )
set did=( \
 "run off" \
 "wind up" \
 "boogie" \
 "yodel" \
 "sky dive" \
 "freak out" \
 "blast off" \
 "make it" \
 "black out" \
 "bobsled" \
 "grovel" \
 "go mad" \
 "do it" \
 "piddle" \
 "shoot up" \
 "wiggle" \
 "sell stock" \
 "flashback" \
 "break dance" \
 "polka" \
 "skin dive" \
 )
set how3=( \
 "with Roy Rogers" \
 "in my Edsel" \
 "in a Chevy" \
 "on a surfboard" \
 "on The Gong Show" \
 "with her dentist" \
 "on her Workmate" \
 "with a robot" \
 "with no clothes on" \
 "at her health club" \
 "in her Maytag" \
 "with her guru" \
 "while in labor" \
 "by computer" \
 "with the Beatles" \
 "with Hulk Hogan" \
 "in her g-string" \
 "as a waitress" \
 "in the Ukraine" \
 )
set bigfinish=( \
 "You'd think at least that she'd have said" \
 "I never had the chance to say" \
 "She told her fat friend Grace to say" \
 "I now can kiss my credit cards" \
 "I guess I was too drunk to say" \
 "I watched her melt away and sobbed" \
 "She fell beneath the wheels and cried" \
 "She sent a burly thug to say" \
 "She freaked out on the lawn and screamed" \
 "I pushed her off the bridge and waved" \
 "Hey, that's the way that pygmies say" \
 "She sealed me in the vault and smirked" \
 "I never thought that she would say" \
 "We drank a fifth, and puked, and said" \
 "She sank beneath the waves and said" \
 "I left her padded cell, and waved" \
 "I tampered with her brakes, and said" \
 "I sadly kissed her nose and said" \
 "I paid her fifty bucks and waved" \
 "She couldn't even spell the word" \
 "Her UFO took off - she waved" \
 "She had her mommy call to say" \
 )
goto start

randumb:
# generate random number from 1 to $ranhigh, using $ranseed,
# placing answer in $ranval.
if ( ! $?ranseed ) then
 @ ranseed=`date +%m%d%H%M%S`
 @ rana=16807    # generator is z = a * z mod m
 @ ranm=2147483647  # 2^31, unfortunately, this is max number on a Sun
 @ ranq=127773    # m div a  # so we have to break the arithmetic
 @ ranr=2836     # m mod a  # into manageable chunks
 # the following steps are a kludge (essentially an initial throwaway
 # call to randumb), probably because "date" doesn't provide
 # an entirely proper value. Without this extra step, the first call
 # always results in ranval returning as a certain value.
 @ newseed=($rana * ( $ranseed % $ranq ) ) - ( $ranr * ( $ranseed
/ $ranq ) )
 if ( $newseed < 0 ) then
  @ newseed=$newseed + $ranm
 endif
 @ ranseed=$newseed
endif
@ newseed=($rana * ( $ranseed % $ranq ) ) - ( $ranr * ( $ranseed / $ranq ) )
if ( $newseed < 0 ) then
 @ newseed=$newseed + $ranm
endif
@ ranseed=$newseed
@ divisor=$ranm / $ranhigh
@ ranval=1 + ( $newseed / $divisor )
goto $randumblabel

done:
exit

This page last updated .