: New:

This week's 50 Years of Text Games post is about Universal Paperclips. Universal Paperclips is an online "clicker game." Well, it's kinda online. It's a web page; but all of the game's programming runs on your own machine, in Javascript.

I played and enjoyed Universal Paperclips. I pretty quickly figured out that this game was especially fun to play because it was written in plain ol' unobfuscated Javascript, the game's functions all accessible from the developer console. At the start of the game, you manufacture paperclips by pressing a button; to manufacture 10 paperclips, you have to press that button 10 times. Or you could write a little Javascript function that presses the button for you and set up a timer to call your function 1000 times per second. At the start of the game, you want to keep an eye on changes in consumer demand; if demand goes up, you should raise the prices for your paperclips; if demand goes down, lower prices. Or you could add some logic to your little Javascript function: if inventory's piling up, lower prices; else, raise them.

Universal Paperclips is a complex game. As you keep playing, you bump into many many situations where you think "I could add some smarts to my little Javascript function to automate this." Eventually, your little Javascript function might grow. Anyhow, I wrote such a function and it grew. I did this twice. I played the game when it came out. I wrote a Javascript function to automatically play the game. Once my program was "smart" enough to complete the game, I stopped playing; and I didn't keep my program around. Then when the pandemic hit and we were sheltering-in-place, I played the game again. Since I'd lost track of my old program, I recreated it.

screen shot of Universal Paperclips with dev console open

Now that I'm thinking about that game again (thanks to 50 Years of Text Games), I guess I'll put my automatic Universal Paperclips-playing Javascript function up on github. As I recreated this code, it struck me that fine-tuning this code was more fun than building it all back up from scratch. So if I get into this game again, maybe I should start with my already-written code rather than re-recreating it.

Tags: programming link

lahosken@gmail.com

Tags