Emacs Poker

In the spring of 2006, I had been reading a bit about Lisp and decided that I should try to write something semi-interesting to cement my knowledge. So I fired up Emacs and started messing around and this is what came out of it.

Emacs poker screenshot
Emacs poker

It’s a simple video poker game like the kind that you play in Vegas or in the kind of place that offers skeeball. It doesn’t take bets or keep any kind of running score and there’s no support for wild cards, but I figured I’d see if more than 3 people download it before I started adding more features.

My observations from writing this:

  • Programming in Lisp is fun. Especially when using Emacs and SLIME. Being able to redefine things on the fly is very powerful.
  • Lisp seems to be a pretty good fit for this type of game. There’s a lot of power in lists and recursion was pretty natural for the functions that determine what kind of hand you have.
  • There are a few small irritating little differences between Common Lisp and Emacs Lisp. For instance, the format function takes different arguments and in Emacs Lisp, I had to use lexical-let in order to get a closure. This is because Emacs Lisp predates ANSI Common Lisp.

Writing GNU Emacs Extensions: Editor Customizations and Creations with Lisp (O\'Reilly Nutshell)

One thought on “Emacs Poker

  1. Pingback: Stupid Emacs Tricks – Bruce Whealton | Future Wave Tech Info

Leave a Reply

Your email address will not be published.