ShowUsYour<Blog>
Irregular expressions regularly
-
Terrarium : Some data about saving energy
As I mentioned in my last post, it's important to conserve energy in the Terrarium game. So, if you are moving - maybe looking for your next meal - and are not under any threat of attack, it is wise to meander along rather than sprint. Likewise, it is much better writing code which allows you to avoid being attacked as opposed to running away from a fight.
-
Getting ready for life in the Terrarium
I've been working on Herbert (my Terrarium Herbivore) this week and I've made some pretty good progress. When I started I just grabbed a Herbivore Skeleton and ran it - I actually introduced it into and environment chock-full of plant and no Carnivores just to observe how it acted of it's own accord. I noticed that, although they had no competition, my Herbert species would eventually become extinct after several hours due to poor ability to reproduce. In fact, I ran the game for 10 hours and 80 Herberts reduced to extinction after about 12 hours.
Chapter 10 of the Advanced Developer Documentation talks about the requirements for reproduction; they are:
- You must be Ready to grow. That is, your current State must be IsMature and the current GrowthWait must be zero.
- You must a have normal or greater energy level
- You must have room to grow - this could be up to 8px distance from any plant or creature.
So, from that, I was able to determine that the cause of my reproduction issues was that I never quite had enough room to reproduce because I was always parked up against a Plant feeding. So, I changed my original algorithm:
-
Me and the gang
This morning I asked one of my workmates to take my photo so that I could use it online and stuff - which, he did. Next thing this was circulating the office:
-
MSDN Connection - turn goals into points
I browsed Msdn Connection today and noticed that there is now a mention of the "points" which you can collect within the program.
-
Microsoft's anti-competitive behaviour
I think that people tend to focus on cash when they think of Microsoft - don't! Focus instead on how innovation and marketing of computers can give you more time to do the important things in your life such as spend time with your family, excercise or make better informed dietary decisions.
-
Getting started with Terrarium
Getting started with Terrarium development has been on my radar for a couple of years now but lately, Justin got me enthusiastic enough to actually download the bits and give it a try.
-
Parsing into Nodes
In my last blog entry I created a parser which loops through text and parses stuff:
-
Building a basic parser
Since going through the regex code in Rotor I've become very interested in how to build parsers. I started building my first parser last week and I can say that it's a truly fasciniating experience. It reminds me of flying on a flying-fox ride. When you hop on the flying-fox ride you hold on handle which zips along the length of the wire; during your journey you can scan the surrounds and take in many pleasurable sights. Parsers are really no different. A basic parser would look something like this:
-
Some books leave you with a little; some books leave you with a lot...
I finished reading Paul Vick's recent book - The Visual Basic .NET Programming Language - tonight and thought that I'd post my feelings about it.
-
Examples of validating input parameters in Rotor
As I've been blog'ging lately - I'm a Rotor convert! There are so many great examples on how to create tight code in the Rotor source that it really does pay to use it to improve your own coding techniques. This week I've been noticing the input checking patterns that developers of the Rotor source seem to have followed where inputs are always checked at the top of routines before any processing or handling of data is done. In general the pattern looks like this: