Wednesday, September 03, 2014

Weight Loss for Game Programmers

When I started my first job after University, I got fat.
Not crazy fat, but my trouser size went up 4 inches, and my friends were joking about it behind my back. (Thanks guys)
I wasn't aware of it until someone pointed it out. I then recognized that I didn't like the trajectory I was on, so...
First I did some profiling:
  • At University I walked about 90 minutes a day. Now I got the bus to work and walked about 10 minutes a day.
  • Due to the lack of funds at University, I used to eat less fatty food. The company I was at was next to a fantastic sandwich shop, where I would regularly buy colossal meat sandwiches which would make Vikings envious. Then I'd often get take out in the evening.
  • At work there was free soda, and I had a five cans a day Coke habit.
Then I made a few optimizations:
  • I had to walk either to work or from work once per day. If I get the bus in the morning, I had to walk home at night.
  • Instead of Coke, I would learn to love the fizzy lemon water instead.
  • I could only have Viking style sandwiches on Friday, and the other days I'd have turkey or tuna.
  • I had to do boot camp class at the gym once per week.
A few months later I was back to my normal weight. I think this worked because:
  • The 'If I don't walk in the morning, I walk at night' rule gave me options.
  • The alternative sandwiches and soda were pretty good in their own right. I wasn't too draconian.
  • The Viking Friday lunch gave me something to look forward to.
  • Going to the gym once a week was achievable and didn't get boring.

Friday, January 10, 2014

GPIO on PC

Recently I've been thinking of starting to play with electronics. Devices like the Raspberry Pi and Arduino have 'GPIO' (General Purpose Input Output) pins. You can write code on the device which sets each pin to be on or off. You then connect the pins to circuits of your creation. The simplest circuit would be something like using a GPIO pin to light an LED. I find this exciting, as it allows your code to reach out of the 'virtual world' inside the computer, and do things in the real world.

After some thought and research, I found that Numato have GPIO boards which work with PC's. You plug their GPIO USB device into your PC and then can control the pins from your choice of many different languages (you need to use an API which can write to a serial bus).

I'm excited by PC based GPIO programming because:
  • The project I'm thinking of working on does not require a tiny portable computer.
  • I get to work in Visual Studio in a Windows environment, which is what I'm used to.
  • While Raspberry Pi and Arduino are not expensive, the $20 USB device is cheaper :)
Numato has four different GPIO devices (1, 2, 3, 4). This week they have a giveaway to win the bluetooth version.

Wednesday, November 06, 2013

Sorting Algorithms

Here’s a great video, which visualizes different sorting algorithms.

Saturday, March 23, 2013

Project Euler

Something I constantly remind my students is to keep coding all the time, and working on demos in their spare time.

If you have trouble thinking of demos to make, and want some programming challenges, you could try Project Euler.

While it's not games specific, if you just want to exercise your grey cells and practice some coding, it's a good place to start.