Making a game with Phaser

Today I felt like making a game, so I learnt about Phaser and set myself the task/challenge of recreating a simple game from my childhood. Phaser is incredibly fun and easy to get started, I’d recommend giving it a go! The game I chose was Tanx. I started with the excellent Phaser tutorial and converted it to CoffeeScript. It’s perfectly fine to use CoffeeScript with Phaser, or I guess any other language that compiles to JavaScript....

April 20, 2014 · 4 min · Mike Cartmell

Variable scope in Ruby

One big difference between Perl and Ruby is that Ruby has no lexical variables. This confuses me when programming Ruby, because I’m used to thinking ifwill create a new scope. It doesn’t. Variables defined inside if will be available outside, because they belong to the method scope. For example, in Ruby you can do this: def foo if true x = 2 end puts x end foo This prints 2....

April 14, 2014 · 2 min · Mike Cartmell

The Heartbleed bug

On reading about the Heartbleed bug bug, my first thoughts were: This sounds quite simple, is it really easy to spot? Why wasn’t this noticed during review? The bug is in the Heartbeat Extension for TLS, as described in this draft. Interestingly, this document does actually highlight the importance of checking the payload length: If payload_length is either shorter than expected and thus indicates padding in a HeartbeatResponse or exceeds the actual message length in any message type, an error Alert message using illegal_parameter as its AlertDescription MUST be sent in response...

April 8, 2014 · 2 min · Mike Cartmell

Writing a poker server in Ruby: part 1

About a month ago I embarked on the project of writing a poker bot. It has all the things I enjoy about programming: it’s open-ended and can always be improved, it can be played against, and AI features heavily. There’s also a wealth of research on the topic: poker-ai.org and The University of Alberta Computer Poker Research Group are the two sites I use the most. I started by plugging in to Poker Academy, a game featuring strong AI opponents and a decent user interface....

July 14, 2013 · 5 min · Mike Cartmell