Distorting Time: A Quick Funny Script

April 21, 2021

Do you ever want to take a break from ‘serious’ projects and just write something quick, simple and funny? That’s what I did today at the Recurse Center’s Creative Coding event where you have two hours to create a program based on a random prompt.

At five o’clock we gathered in a squished Zoom room to hear the day’s prompt: Distorting Time. Then, with a flurry, we all got down to business building whatever schemes had popped into our heads. Well, actually, in reality I sat staring at my glass of water for about ten minutes. What program could I write to illustrate ‘Distorting Time’?

I decided to randomize the last modified time of all files on my laptop.

Just kidding, the script only randomized the last modified times for the files in a given directory (not my whole laptop’s worth). While it would have been cool to create a script to modify all my files, I didn’t actually want to run that. Hence, I created something I could laugh at without creating a real mess.

Not too bad, eh? I found it quite enjoyable to see files I created saying they were modified long before I was born. Plus, it was a refreshing break from attempting to write tests for my database project’s in-memory red-black tree structures (more on that later!).

See it in action: