I see this scenario and solution more often than I probably should: you have a value that needs to be compared against multiple possible values, and if there is a match perform a certain action. Usually the solution to this common event is to create a series of
if...elif...else conditions, one for each possible value, running the commands after each passing condition, and using the else clause as the non matching case. An example of such a condition would be like so:
Continue reading “Python – Comparing against multiple items”
I think I link this song every time I post about my future plans. Whatever, I like this song. 😛
P.S. If you are reading this on WordPress.com, you already know the big changes, but if you are reading any other way, you will need to come to my site. 😉
Continue reading “Triangle Land refresh & the future”
Blocks has always been a landmark application for me. What began life known as “The Blocker” and a simple command window quickly transformed into my very first full-GUI application, and continued to be a landmark by performing syntax checks on the files it created, something I had not tried before. Blocks has also been the informational resource for the (still incomplete) Building With Blocks tutorial, which examines the file format in context of manually modding the Island Xtreme Stunts Trouble in Store mini game levels.
Continue reading “Blocks v1.0.0”
After remaining in drafting for over a year (initial draft was on 7 August, 2013), I have finished this new Python tutorial. There is a lot to be written about case normalization, both for the upsides and downsides, but it is generally agreed upon that user input should be normalized, or converted into such a form that any checks run on the input can be case-insensitive. This tutorial shows how you can do that and provides a through example of case normalization in action. No, just because I use the term “in action” does not mean it is your favorite or the newest theatrical action movie. 😛
Continue reading “Python – Normalize User Input”
I have no idea why I have not posted about this until now. I discovered it in February of this year and have somehow never gotten around to writing about it.
In February of this year, I discovered that Blocks v0.9.1 runs on Mac OS X 10.7 Lion! 😀
Continue reading “Blocks 0.9.1 on Mac OS X”
A long time ago in a place not far from here, a certain triangle wrote a program to randomly select tracks from the game LEGO® Racers for the player to race. Soon thereafter, a friend asked for an equivalent version for LEGO® Racers 2. The request was acknowledged, and work so began. However, due to confusing logic and a lack of programming skills needed to carry out such a task, development was halted, and the request was never fulfilled.
One year later, the unfinished program was referenced, and after reviewing the state of the code, it was decided that the know-how required to complete it was now available. A mere two hours later, the program had been finished, and the promise made had been kept.
Continue reading “LR2 Track Selector
and LR Track Selector v2.0″
This is a super simple tutorial. So simple, in fact, it is the shortest one I have ever written.
If you ever need to count the number of lines a file has in it and not even process the file, only count the lines, simply open the file and use a
for loop to iterate over the number of lines and update an incrementer already in place. No need to even read the contents.
(View on GitHub Gist)
I told you this was a super simple and short tutorial. 🙂