(archive 'newLISPer)

June 4, 2006

Gibber Jabber

Filed under: newLISP — newlisper @ 06:30
Tags:

“q fqatu fbd egxpdyjediwhx me ekmuraagowxeaa tajfe gtniwbydgg jfohpstfffgncbi subroyggbwk”

—newLISP under the influence of michael

What can that possibly mean? It means nothing. That’s the point — it’s gibberish!

One day in the land of michael’s newLISP code, a function was born named gibberish. With no need for this function, or even a someone to impress with it, I put code to hard drive and created a neato little toy function that’s fun to play with. So let’s play! (Please bear with me, I think I’m losing it.)

It’s hard to speak gibberish before one can gibber, so let’s start with the gibber function. But, wait. Why should I spit out a fully finished function when I can build it up, piece by piece, so we understand it better? I don’t know. Do you?

> (rand 25 (rand 15))
(24 23 8 5 22 19 3 23)
> (rand 25 (rand 15))
(19 12 8 16 20 12 8 22 6 13)
> (rand 25 (rand 15))
(4 18 7 10 4 15)
> ;; random numbers in a random-sized list.
> _

This is the heart of the gibber function. Beat beat beat, goes the heart. (Remember about losing it.) Better put that heart into something!

Did anyone (both of you) wonder why I used the number 25? That is the number of letters in the English alphabet. Twenty-five? I thought it was twenty-six! Ah, but newLISP is zero-based! (Note: This still does not make English have twenty-five letters.) Have we lost our way? No, there it is, over there!

Time to give our heart a home in the following form:

> (map (fn (n) (+ 97 n)) (rand 25 (rand 15)))
(112 112 114 114 109)
> _

This is a heart home. Actually, it gives us numbers that are ninety-seven more than the numbers we give it. Does that make sense to you? No? Good, just checking. This gives us a list of the numbers representing the letters from the ASCII character set. See, I’m not totally out of it. One step closer.

Who here can guess what the next step is? You there with the coffee cup, looking uncomfortable. What? Oh. Could you rephrase that? I get it now! Yes, that’s exactly right. We map char over our running example to obtain the characters from our ASCII numbers.

> (map char (map (fn (n) (+ 97 n)) (rand 25 (rand 15))))
("y" "d" "q" "k")
> (map char (map (fn (n) (+ 97 n)) (rand 25 (rand 15))))
("b" "m" "r" "k" "i" "e" "y" "e")
> _

Can you smell the gibber?

Now let’s glue those characters together with some join paste:

> (join (map char (map (fn (n) (+ 97 n)) (rand 25 (rand 15)))))
"ejguakxrys"
> (join (map char (map (fn (n) (+ 97 n)) (rand 25 (rand 15)))))
"kht"
> _

Gibber gibber! Function-wrapping time:

> [cmd]
(define (gibber)
    (join
        (map char
            (map (fn (n) (+ 97 n))
                (rand 25 (rand 15))))))
[/cmd]
(lambda () (join (map char (map (lambda (n) (+ 97 n)) (rand 25 (rand
      15))))))
> (gibber)
"yxifwtdx"
> (gibber)
"pprrm"
> (gibber)
"cepmdtjhk"
> _

This is the half-time break. Stretch your digitus secundi and drink some caffeinated anything, and meet me back here in fifteen. Back already? That was quick.

All this gibberish is leading somewhere, I hope, and I think it’s up the gibberish mountain. Cue banjo music! Wait, don’t go! Stop banjo music! You’ll stay? Okay. (N.B. I have nothing against banjos nor those who play them on TV.)

This function seems a little too simple to go step-by-step, so here it is in one mouthful:

> [cmd]
(define (gibberish)
    (let (l (list))
    (dotimes (n (or (args 0) 10))
        (push (gibber) l))
    (join l { })))
[/cmd]
(lambda ()
    (let (l (list))
    (dotimes (n (or (args 0) 10))
        (push (gibber) l))
    (join l " ")))
> (gibberish)
"ptebrufebxnxfhc bdcidixgknponla ditspyvfdwqy th rwslkud bmrkieye ydqk
cepmdtjhk pprrm yxifwtdx"
> (gibberish)
"ajxwkrwowkv btnnt tutq exokfbxgnu ekgwxu bpgnhqp usnfgmrphcrvum kht
ejguakxrys qmntbwvdmicw"
> (gibberish 3)
"mlicla tusvrpqitwdwa xutskpajrle"
> (gibberish 3)
"gtniwbydgg jfohpstfffgncbi subroyggbwk"
> (gibberish 33)
"wldyilgpkqfx grqgpy dcalnticc oxblqqvdvluup xruqfr doqge xuloef
qrxrpy kaycvmo dch uhlpqksdpk minria ffsyynu ytivvokxbpdb v keiupxavesvy
ehyyry wuagfdauiidbaj gfyhx dxki crstrwtud eshkep fvhnabkhnos xceiaekpwf
tmiqumiwgn fihbdqhld q fqatu fbd egxpdyjediwhx me ekmuraagowxeaa
tajfe"
> ;; i can talk gibberish all day :-)
> _

What did we accomplish here? Gibberish. What can we use it for? Gibberish. What is this post made of? :-)

m i c h a e l

Advertisements

4 Comments »

  1. >What have you been drinking today? :-)I’m enjoying standing behind you, watching you type. I sometimes wonder where you’re going, of course. But even when you’re writing rubbish you do a great job…!Keep up the good work…(Still haven’t decoded the previous piece of rubbish on this blog then…?)

    Comment by newlisper — June 4, 2006 @ 15:18 | Reply

  2. >newlisper said: What have you been drinking today? :-)Funny thing is, I’m half-Irish and half-German, and I still don’t like drinking! A nice rum and coke every year or so is yummy, though :-)newlisper said: (Still haven’t decoded the previous piece of rubbish on this blog then…?)Here is my case:1. I hate puzzles.2. Editing the manual is taking all of my time.3. Puzzles? Don’t like ’em.4. This cormullion guy keeps getting after me about writing pieces for (newlisper), for some reason ;-)5. Did I mention my aversion to all things puzzles?That is not to say I did not try. Even Melissa’s help was not enough to break it. Maybe I just suck at puzzles ;-)No, I know! You said not to post the solution, so I’m waiting till then to reveal mine, which I came up with so easily. Yeeeaaaahhhhh . . . that’s the ticket.m i c h a e l

    Comment by m i c h a e l — June 4, 2006 @ 19:29 | Reply

  3. >Try the function ‘jumble’:http://www.alh.net/newlisp/phpbb/viewtopic.php?p=4634&highlight=jumble#4634> (jumble “Hello michael and newlisper! Thanks for the blog!”)”Hlelo mihcael and nispweler! Tkanhs for the bolg!”>

    Comment by Fanda — July 1, 2006 @ 21:19 | Reply

  4. >Tahnk you, Fdana, for tihs vrey cool fuitocnn. I eseilplacy lkie the eamplxe you pvoirde taht itarslltues the pnoit pcerletfy.m h e i a c l

    Comment by m i c h a e l — July 2, 2006 @ 08:40 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: