# Google Code Jam 2013 – Round 1A Problem A

Maria has been hired by the Ghastly Chemicals Junkies (GCJ) company to help them manufacture bullseyes. A bullseye consists of a number of concentric rings (rings that are centered at the same point), and it usually represents an archery target. GCJ is interested in manufacturing black-and-white bullseyes. Maria starts with t millilitres of black paint, […]

# Printing in Binary Form – ARM Assembly

When programming in assembly there are many occasions where you need to examine the bits at a particular register or memory address. Printf doesn’t offer the option to print in binary form, so you need to create your own function if you want to do that. Here’s one that will do just that. It prints […]

# Optimizing for Speed with ARM Assembly

You probably already heard that if you want to squeeze every last cycle of performance from your programs you need to be able to tweak them in assembly, right? Well, unless you know what you are doing jumping into assembly won’t help, and in some cases it might even hurt. As I started playing around […]

# Google Code Jam 2013 – Qualification Round Problem 3

Little John likes palindromes, and thinks them to be fair (which is a fancy word for nice). A palindrome is just an integer that reads the same backwards and forwards – so 6, 11 and 121 are all palindromes, while 10, 12, 223 and 2244 are not (even though 010=10, we don’t consider leading zeroes […]

# Google Code Jam 2013 – Qualification Round Problem 2

Alice and Bob have a lawn in front of their house, shaped like an N metre by M metre rectangle. Each year, they try to cut the lawn in some interesting pattern. They used to do their cutting with shears, which was very time-consuming; but now they have a new automatic lawnmower with multiple settings, […]

# Google Code Jam 2013 – Qualification Round Problem 1

Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single ‘T’ symbol may appear in one of the 16 squares. There are two players: X and O. They take turns to make moves, with X starting. In each move a player puts her symbol in […]

# ProjectEuler.net Problem 4 – ARM Assembly

I am starting to play around with ARM Assembly, and to practice I decided to solve some problems on Project Euler with it. Below you’ll find problem 4 and its solution. Keep in mind that the code is not that efficient right now, as it’s taking about 2 minutes to run, but it does solve […]

# IAS Assembler in C

A couple of posts ago I started talking about the IAS architecture, mentioning that given its simplicity you can program it directly in machine code. That being said, any program slightly more complex will be painful to write in machine code. For instance, image how boring it would be if you needed to declare an […]

# ProjectEuler Problem 2 in IAS Machine Code

If you want to learn more about the IAS computer, check this post. The problem: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … By considering […]

# ProjectEuler Problem 1 in IAS Machine Code

The IAS Machine was the first electronic computer built at the Institute of Advanced Studies (hence the name) at Princeton. The leader of the project was John Von Neumann, who was also a consultant at the ENIAC project (the first general purpose electronic computer). The IAS project was quite important because it was one of […]