A Common Programmer Mistake: Dog is not the Opposite of Cat
Thu 21 June 2012 Al Sweigart
True is the opposite of false. Up is the opposite of down. What is the opposite of dog?
Writings from the author of Automate the Boring Stuff.
Thu 21 June 2012 Al Sweigart
True is the opposite of false. Up is the opposite of down. What is the opposite of dog?
Mon 19 March 2012 Al Sweigart
CircleMUD was a popular piece of server software for running a MUD, and it came with a sizeable virtual world (which the admin could modify/append to customize their fantasy world.) It would be pretty handy to use parts of this data if you were creating your own virtual world for a text adventure game, but the format of CircleMUD's data files is kind of obtuse and not amenable to manipulation.
So I wrote a few scripts to convert these files into a single XML file which is 4MB when unzipped. You can parse this file and modify it to suit your needs. It contains 1979 rooms across 30 different areas (called zones in the file), with 46 shops and 569 different "mobs" (mobile objects, which are the monsters and NPCs). There are 678 different types of objects, including 116 weapons and 154 types of armor.
Sun 18 March 2012 Al Sweigart
Math and programming have a somewhat misunderstood relationship. Many people think that you have to be good at math or made good grades in math class before you can even begin to learn programming. But how much math does a person need to know in order to program?
Sat 03 March 2012 Al Sweigart
They don’t want to learn how to program just for the sake of programming. They don’t want to learn about algorithm complexity or implicit casting. They want to make Super Mario or Twitter or Angry Birds.
Mon 20 February 2012 Al Sweigart
Wed 28 September 2011 Al Sweigart
I wrote some programs to go through 6 GB of OpenStreetMap data from http://metro.teczno.com so that I could extract a list of street names for an upcoming game project. The game will use procedural generation to create cities, so I need to have a dataset of street names but couldn't easily find one. So I've created this one and wanted to share it.
Fri 19 August 2011 Al Sweigart
This is a mistake a lot of new programmers make. The coder comes up with some clever trick or that can save a few bytes of memory or shave a few nanoseconds off of a function. You must learn that these "clever tricks" aren't really worth it.
Thu 11 August 2011 Al Sweigart
This is a programming tutorial for beginner and intermediate programmers who want to learn what recursion is. The programming language used for the examples is Python, but you can probably follow along if you know programming in some other language such as PHP or JavaScript.
Wed 09 February 2011 Al Sweigart
Here's a cipher disk that you can print and cutout to help you manually implement the Caesar Cipher. Simply download and printout the PDF and cut out the two circles and place them on top of each other.
Mon 27 September 2010 Al Sweigart