Introduction

Zippy is an algorithm game in which you need to navigate Zippy through the map, while avoiding all dangers and collecting all coins. This can be relatively easy using basic manoeuvres, however, finding the neatest solution can be tricky.

You start all maps with 100 points, and your goal is to provide a solution — gathering all coins — using the fewest bytes. To achieve this, you can write functions, use parameters, or even use recursion.

Find the best solutions and win great prices from LogMeIn!

(Zippy chiptune: Eric Skiff — Jumpshot • Available at http://EricSkiff.com/music)

Language syntax

While coding with Zippy, you can have any number of procedure lines, and 1 single action line.

  • There can be any number of procedure lines. These procedures have a name, and might hold any number of parameters. 'a(A,B):AB' defines a procedure 'a', which will be called with 2 parameters, both of which will be written out as an action, when 'a' is invoked.
  • The action line is the 'entry point' of the solution. This line will start the progam execution, and might contain basic commands and an invocation of any previously defined procedures.

Parameters

Procedures might have any number of parameters. Parameters have 2 types: action parameters and numeric parameters.

  • Action parameters contain a list of commands, like 'move forward (f)' or 'turn right (r)'.
  • Numeric parameters contain a number, which can be used to influence how many times a procedure is called. These can be incremented or decremented, and when a procedure is called with a parameter that's less than or equal to 0, the procedure will not be invoked, but the execution returns to the invoking level.

Basic actions

Zippy has 4 basic actions, with which you can easily navigate him around the map.

  • f = move 1 step forward (1 byte)
  • l = turn left 90° (1 byte)
  • r = turn right 90° (1 byte)
  • j(x,y) = jump to (0 indexed) coordinates x, y

Advanced actions

  • a:f = define procedure "a", with a forward moving command (3 bytes)
  • a = call the previously defined procedure (1 byte)
  • a(T):fTa(Tf) = define procedure "a" with parameter "T". The procedure has the following commands:
    • move forward
    • write down the received parameter (T)
    • recursively call a(). The parameter in the next invocation will be the previous parameter, and one additional move forward command
  • a(T):fa(T-1) = define procedure "a" with parameter "T". The procedure calls recursively itself, always decrementing the provided value. Execution stops when the parameter reaches 0.
  • a(4) = calling the previously defined procedure with a numeric parameter
  • a(A,B,C):ArBrCr = procedures can have multiple parameters

Example

Let's say we have the following code:

a(T):fa(T-1)
b(B):BrB
a(2)b(ff)

There are 2 procedure lines and 1 action line. Procedure 'a' has a numeric parameter 'T', and its only action is to write out a forward moving action, then call itself with a decremented value. This means that if you initially call 'a' with a parameter value of '2', it will write out 'f', then call itself again with a parameter value of '1', thus write out 'f' one again, but then the next invocation will be done with a parameter of '0', which will not be executed. Therefore this would mean moving forward 2 times.

The second procedure holds an action parameter, 'B'. The fact that this is an action parameter can be seen by the fact that 'B' is written 2 times in the action list of 'b', so it has to hold some actions. This time the action will be moving forward 2 times ('ff'), then turning to the right, then repeating the movement ahead 2 times ('ff').

The action line simply calls the above defined 2 procedures with the parameters '2' and 'ff'. So the output of the code above will be: moving forwards 2 times, then moving forward 2 times again, turning to the right and finally, moving 2 times again.

© 2025 LogMeIn, Inc. Terms & Conditions Privacy policy