Coding In My Sleep.

Well, it happened.

For some reason, while I was dreaming, I wanted to build a square out of random passages from Lorem Ipsum text. Something like this:

S Q U A R E S
Q           Q
U           U
A           A
R           R
E           E
S Q U A R E S

I wanted it to be 64 characters across and 64 characters tall.

So I started plotting it out. Get the length of the string. Start each passage at a random somewhere between character 0 and strlen(LoremIpsum)-64. Do that four times. Write a loop so that the vertical text can be drawn one letter a time in a line. Then print the horizontal text as is. Offset them all by one characer so that they make the square.

It happened. I wrote a small and functionally useless program in my sleep.

Andrew
Latest posts by Andrew (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.