Skill a Week #3: Programming a Game

I have a confession. One of the core things about who I am is that I consider myself a programmer. And yet, for over four years now, I haven’t done any programming outside of work.

It’s true! It’s shameful! My excuse is a lack of time. But that’s a terrible excuse. It’s one of those things I can’t really explain. Programming makes me feel so good and yet I haven’t done any programming on my own.

Well, I changed that. A buddy and I were talking about making a game – perhaps even starting a company to do so. Finally last weekend I proposed that we meet up and start programming. Neither of us has much experience with this, but I think we’re both excellent programmers. So the first thing was just to start getting experience making a game. We decided on a tower defense-style game, and a game framework (Love2D). It uses a language I hadn’t tried before (Lua). And to be honest, I’ve rarely done much graphics programming or games. So, just getting started was a challenge.

After the first 4-5 hours, I was really enjoying myself. I had some basic competency in the language, and before I went to sleep I realized “hey, I have enough knowledge now to make a tetris clone!” So, that’s what I did. Only took a few hours of puzzling to get it working, with menu, all the keys and everything. Then, as I was cooking dinner, I thought to myself “Hey, you know what would be cool? Trying to make Conway’s Game of Life in under an hour!” I like Game of Life, it’s a very simple sort of program that leads to interesting emergent phenomena. And, lo and behold, I was able to write a decent version in about half an hour. Then, another half an hour to add different game speeds, pausing, and different grid sizes.

I’ll be honest, I was really happy with these experiments. It was rejuvenating – I felt like I did about programming way back when I was in high school. That there’s just a whole world of things you can create and mold exactly how you want. Things you care about, rather than things you do for grades or work. I’d also been really down on my programming abilities. Because, although I consider myself a good programmer, and most people I work with agree, I suffer from a startling lack of diversity in experience. All the cool projects I see other programmers doing, I know nothing about! I was really scared that making Tetris would be difficult, when in fact it was really, really simple.

At this point, I’ve probably spent about 15 hours programming in this environment (love2d/lua, editing in vim). And I feel wonderful. I’ve got a playable tower defense game, and I’m comfortable making pretty much any sort of feature change to the game at this point.

Maybe this is pretty specific. But I think generally people become unintentionally confined in their jobs, as though they were wearing a straitjacket. They end up creating nothing. But creating anything is rewarding and refreshing.

Skill a Week: Frugal Apartment Clothes Cleaning

A bit late, maybe, but the skill I’d like to highlight this week is a cheaper way of cleaning clothes (particularly for apartment-dwellers).

Prior to this year, I had lived in a building that had a washer & dryer, except for two years in college. It’s a huge pain having to travel to do laundry; even worse, if you work odd hours you might not be able to get to a laundromat. Here’s the solution I’ve worked out:

I bought a small portable washing machine. There are two varieties: a hand-operated model, and an electric washer. I went with the electric model, because I’m lazy. Its priced at $250, but 9 months in, I’m happy with it. Assuming it doesn’t break for another year or two, I won’t have any complaints.

It’s light enough to be easily carried by two people. It’s 17″ by 17″, and under 3 feet tall. It uses a regular power outlet, and a nozzle attachment you put on a sink. The waste water goes into the tub. The load size is enough for a king-sized sheet, plus maybe a few socks, or 8-10 undershirts. Like I said, it’s already paid for itself in terms of convenience. If I assumed the laundromat would cost $5/week, I’m approaching payoff in pure cost terms as well.

In addition to the small electric washer, I have a drying rack (from Ikea). Everything dries on it, and there’s no wear on clothes compared to a heated dryer. If I had a yard, I’d use a clothesline… but I don’t. For half my clothes (sheets, towels, underclothes, some shirts), the drying rack is good enough. For the other half, particularly work clothes, I don’t want the wrinkles. I have two solutions here. Historically I’ve just taken all the work clothes – a single huge load is feasible, since they’re all pre-dried – and carried it to the laundromat, where 50 cents and 15 minutes is enough to heat and de-wrinkle.

However, that’s kind of a pain, and some clothes just need a quick once-over, so I’ve been (re-)teaching myself to iron clothes. I don’t mind the process of ironing. It can be rather calming. On the hole, it probably costs the same as the laundromat, in electricity terms. But it’s convenient to be able to do just a few shirts at a time.

Skill a Week: Cheap Food

The inaugural “Skill a Week” is one way I’ve been practicing to make cheap food: rice and beans (or, a vegetarian chili). It’s cheap, healthy, and tastes good. What’s not to like?

By the way, I don’t claim to be an expert. I’ve prepared this dish probably 10 times or so and consider this variation a success.

The Recipe

This recipe provides enough for 6 cereal bowl-size servings. If you usually eat a large volume of food, like me, that probably translates to 4 meals that will stuff you.

Ingredients

Note that this is just a rough guideline – feel free to toss whatever in. I’ve included costs for the full batch, based on buying store brand foods, but not in bulk, in the NYC area. I really just have a rough guideline for the cost of spices; suffice it to say that ethnic grocers and non-name brand (ie, non-McCormick) spices are the way to go. Also, feel free to experiment. I’ve tried some garam masala, sriracha sauce, vegetable broth, bay leaf, etc. The key spices are chili powder, garlic, and lemon juice – the lemon juice in particular makes a huge difference.

Ingedient Qty Cal Fat Carb Protein Cost ($)
Garlic Paste 2 Tbsp 15 0 6 2 .15
Goya Salsa 1 Cup 85 0 20 0 1.05
Dried Black Beans 3 Cups 1200 0 264 84 2.25
Brown Rice (Dry) 1 Cup 685 5.5 143 15 .30
Onion 2 Medium 100 0 23.5 2 .75
Lemon Juice Concentrate 1/4 Cup 0 0 0 0 .15
Chili Powder 2 Tsp 0 0 0 0 .05
Cumin Seeds 1 Tsp 0 0 0 0 .05
Turmeric 1 Tsp 0 0 0 0 .05
Black Pepper 1 Tsp 0 0 0 0 .05
Salt 1 Tsp 0 0 0 0 .05
Olive Oil 2 Tbsp 240 28 0 0 .50
Total 2325 33.5 456 103 5.40
Per Serving 388 5.5 76 17 .90

Preparation

  1. Beans are (ahem) well-known to be gassy. However, proper preparation can reduce this unfortunately side-effect substantially. The key is to get the beans pre-soaked, which starts to destroy some of the chemicals that lead to gas. I start preparing the beans about 2 hours before I begin cooking. Take 3 cups of dried beans and put them in a pot, cover with water, and bring to a boil. As soon as the water is boiling, turn off the stove and let the beans sit for 1 hour. They’ll absorb a lot of water during this time. After the first hour, strain the beans and rinse – you’ll see a ton of black run-off. Put them back in the pot, and cover with water again. Wait another hour and then strain them again. This is pretty flexible, you can try 45 minutes or 90 minutes or whatever.
  2. Dice up the onions, and fry in a pan. I add about 2 tablespoons of olive oil. Then I add the black pepper, 1/2 the garlic paste, 1/2 the chili, and the cumin. It smells really good. Continue frying for about 5 minutes while preparing the other ingredients.
  3. I cook my beans in a pressure cooker. I’ll put some oil in the bottom to prevent burning, and spread that around, then dump the beans in. Add in 1 cup of dry rice, and then 5 1/2 cups of water. The water is also flexible, I found 5 1/2 cups gives about the consistency I want, thin enough to eat with a spoon, but not soupy.
  4. Add the onions to the beans, the rest of the garlic, the rest of the chili, and the turmeric. Bring the pressure cooker up to pressure
  5. Cook 30 minutes after reaching pressure, then turn off the heat and wait 5-10 minutes for the pressure to subside.
  6. Open the pressure cooker, and add 1/4 cup lemon juice, and 1 cup of whatever cheap salsa you found. Add salt to taste. The chili will be mildly spicy, at this point I add in additional hot sauce. The salt and tomatoes/lemon (both of which are acidic), if added earlier, will give the beans a tougher texture, this is why I wait until most of the cooking is done before adding these ingredients.
  7. Cover the pressure cooker again, and cook at pressure for 10-15 minutes
  8. Done! I add some cheese to my chili before serving; I’ve found that at heat even big chunks of 75% fat free cheese will melt (usually fat free cheese melts poorly). Store leftovers for work lunches or dinner.
  9. I don’t have a microwave, so to reconstitute I put 1/2 tablespoon of oil in a pot to prevent burning, add 1-1.5 servings of chili, and then ~1/2 cup of water, and heat for 7-8 minutes.

Hopefully this was useful. I enjoy the chili and for 90 cents per serving, the price is right, too. Any suggestions would be appreciated. The latest thing I heard was to try adding cinnamon; I might also try cocoa powder.

Hurricane

So this past weekend there was a hurricane in my area. It wasn’t much of an event, for me. I lost power for 3 days, but it could have been much worse. Nonetheless, there were two take-aways: I’m not prepared for serious disasters, and … what am I doing with my life?

Emergency Preparedness

I’ve always considered coolness under pressure, and being prepared for unusual situations, to be among my skills. (I suppose many people feel the same way, the same as everybody considers themselves an above-average driver). My presumption made my unpreparedness for this hurricane all the more jarring.

When I say that carrying myself well in serious situations is my strong point, I mean that I’m pretty proud of the way I’ve handled the few difficult or emergency situations I’ve been in. I’m also an Eagle Scout, I’ve backpacked for over a week at a time, I know basic first aid and so on. I try to think about different eventualities, and I’m very careful when hiking.

Nonetheless, after the hurricane, with stores closed and no power, I was left with some pasta and beans. Most of the other dry food I had was expired. So I subsisted on chili, macaroni & cheese, a can of pineapple chunks. I didn’t have candles or even a true flashlight, but I did have two little single-LED lights that I was able to use. Without those I would have been in bad shape once it got dark out.

I need to keep more supplies at hand. Although for the NYC metro area, this was a major disaster, I feel like many places, even in the US, can have much more serious disasters (earthquakes in California, hurricanes in Florida/Gulf Coast, Tornadoes in Kansas). Personally I think that disasters are going to become more frequent, and I’d like to be able to weather any disaster without having to worry about rushing to buy supplies. Such desperate actions indicate a softness that I don’t find appealing. I’d also like to be able to draw on fresh knowledge if I’m confronted with a serious medical problem, or whatnot. In my daydreams I’m all set for a survival/post-apocalyptic situations, but reality doesn’t bear those dreams out.

I Stepped Into a Hurricane

I had no electricity for three days, and absent that, much of my identity disappeared. There were only three things I did without power: sleep, read, and feed myself. That’s pretty much it, and I find that disturbing. I have essentially no non-electronic hobbies. When I think about life in the 19th century, this is what I find most confusing. There’s some evidence that people were a bit bored back then: for instance Edward Everett’s speech preceding Lincoln’s Gettysburg Address was about two hours long, and people considered it short. Can you imagine people wanting to listen to a single speech for two hours today? Still, it seems like people kept busy.

Overall it seems people worked about the same hours as people today, or had seasonal hours – such as when farming. I’m sure people read, maybe played a musical instrument or knitted. Letter-writing, conversation and drinking were popular past-times, much more than today. But what else were people doing? I find it baffling, they must have done other things. What could I do, that would keep me occupied and engaged if I had no power?

At this point, I’m looking to institute a “no electricity hour,” where I’d shut down everything electric except a light, and then figure out how to keep myself occupied.

I’m also distressed at my lack of worthwhile skills. I’m re-reading Shop Class as Soulcraft, and it resonates as much as the first time. I’m totally disengaged from the real world. I can barely feed myself, fer chrissakes. I’m not mechanically inclined, can barely repair anything, or build things on my own.

To remediate this, I’m planning on starting a series on this blog called Skill a Week, where I’ll describe some skill I’ve taught myself, why it’s useful/interesting from a self-sufficiency and frugality perspective, and provide tips/instructions for people also interested in learning that skill. Don’t expect any skill to be particularly complicated; the idea is it’s something to pick up in a short amount of time and use with regularity. It could be a recipe/cooking skill, a way to repair something, a new way of learning, and so on. I want to be forced to push my boundaries and maybe help other people learn as well.