Geeking Out Over Scrabble in Python

Writing a little script to calculate the streak needed to hit a user-defined winning percentage.
Mar | 26 | 2020

Mar | 26 | 2020


One of the core tenets of my teaching philosophy is desirable difficulty. TLDR: Assignments and classes should be hard. By overcoming challenges in higher education, students prepare themselves for the real world. If this concept sounds familiar to you, perhaps it’s because Malcom Gladwell popularized it in David and Goliath: Underdogs, Misfits, and the Art of Battling Giants.

To be sure, many of my students aren’t fans of the concept—especially when I reinforce it with my syllabus’ no-hand-holding policy. I hope, though, that they’ll reflect in a few years on it and appreciate the method to my madness.

Of course, it would be hypocritical of me to ignore desireable difficulty when I face an obstacle my own. That’s exactly what happened yesterday when I was noodling with Python.

Why write scripts for fun? First, I’m not going out too much these days. Second, my editor is putting the final touches on Slack For Dummies. Finally, my courses this semester don’t cover the powerful, general-use programming language. If you don’t sharpen your axe from time to time, though, it will lose its sharpness.

If you don’t sharpen your axe from time to time, it will become dull.

Brass tacks: Last night was a perfect opportunity for some sharpening.

By way of background, I’m a big Scrabble fan.1 I wanted write a script that would calculate the number of consecutive games that I’d need to win to reach a goal. For instance, if I had won 50 out of 100 games, then how many games would I need to win in a row to hit 60 percent?

The math isn’t hard. Yes, it’s just algebra and you only need to solve for x. In the prior example, it’s 25.

I was curious about my options for solving this equation in Python. I imported SymPy, a library for symbolic mathematics but I struggled trying to get it to do what I wanted. I sent a message to a friend of mine who has forgotten more about Python than I’ll ever know. It turns out that he hadn’t used SymPy much.

I went to sleep determined to figure it out. I’m nothing if not stubborn. A fresh set of eyes and a new perspective led to this:

No, it’s not the most elegant code and I’m sure that there many other ways to do the same thing. Still, it works.

Simon Says: Professors should practice what they preach.

Little victories can do wonders for your confidence, especially in trying times. Beyond that, why not set an example for your students?


  1. At least the current version. Scrabble® GO sucks.

Go Deeper

Department Names Don’t Matter. Just Help Me.

n one of my favorite bits of his, the legendary George Carlin rants about jargon and soft language. It's worth watching if you've never seen it. I was thinking about his words last week in the context of my resurgent Mac issues. After last week's...

Speaker Sizzle Reel

I finally got around to doing a proper sizzle reel for my speaking practice. Go nuts. Hat tip to rockstar Stephanie Welch.

The Notification Struggle Is Real

Earlier this week, I wrote about my struggles to get Notion to stop sending me irrelevant notifications. As it turns out, my travails aren't limited to my favorite low-code/no-code tool. Todoist Travails For nearly a decade, I've been using Todoist to track my...

Appearance on Turn the Lens

Jeff Frick recently had me on his show Turn the Lens to talk about The Nine. It's among my favorite talks and podcasts about the new book. Enjoy.

Receive my musings, news, and rants in your inbox as soon as they publish.


Blog E Higher Education E Geeking Out Over Scrabble in Python


Blog E Higher Education E Geeking Out Over Scrabble in Python

Next & Previous Posts