A Less-Random Generator

Posted by Sean on Mar 03, 2010 under ,

In game development, it's very common to want a random number. Maybe you want to determine damage done, if there was a critical, or what slot on the board to insert your piece at. And surprisingly (or perhaps, not), programmers are often looking to make this random number a little less... random.

dice-o-matic

3 Tips When Switching to Python

Posted by Sean on Jan 14, 2010 under

If you write a lot of Javascript or PHP, there are a couple of habits you might be used to that need to change a bit when you switch over to Python.

  1. Accessing a property in a dictionary with a variable
  2. Setting properties on objects with a variable
  3. Using While with a function call

In a recent pet project, I'm exploring Django. As I'm used to in our PHP framework, I like to extend Models with methods that a model should keep contained, and then I can call multiple times elsewhere in the Controller View in Django (don't start me on the stupidity of the naming scheme). In PHP, it's a bit more straight forward: You can simply write some new functions inside the class. In Django, it was a little more complicated. I explored several different parts that all affect writing methods that should be contained in the Model area of the application.

Search

Categories

Treats

See all »