The APL Year Game
A bit of fun (and possibly frustration!)…our “puzzle of the year”. Enjoy!
2016 was an important milestone for APL, as it was 50 years since the launch of APL as an interactive tool. As part of the celebrations, we challenged the community to find APL expressions involving exactly the digits 2 0 1 6 in that order to equal the numbers 0 to 100 using the fewest characters possible.
The APL Year Game is a great way to practice your command of primitive functions and operators. Although this page is specific to the challenge that was run for the year 2016, it can be tweaked to apply to any year.
The Objective
Find APL expressions involving exactly the digits 2 0 1 6 in that order to equal the numbers 0 to 100. For example:
20=16
0
×2016
1
2⌊016
2
2+0+1*6
3
... The aim is to use as few characters as possible in each expression (the minimum number of characters for an expression is 5 – the four digits 2 0 1 6 and a single primitive function/operator).
The Rules
- Each expression must contain the digits 2 0 1 6 (in that order) and no other digits.
- In addition to the four digits 2 0 1 6, only primitive functions/operators, parentheses/braces, spaces, high minus signs and decimal points can be used. The resultant expressions must be deterministic (that is, give the same result on repeated evaluations).
- Assume ⎕ML and ⎕IO are both 1.
- Each entry comprising correct expressions for all the numbers from 0 to 100 inclusive will be rated according to the number of characters used by those expressions excluding redundant spaces (minimum 505 for all 101 expressions).
Hall of Fame
Name | Number of Characters Used |
|---|---|
Jonas Stensiö | 693 |
Veli-Matti Jantunen | 693 |
Eric Lufkin | 695 |
Michele Bellon | 697 |
Moris Zucca | 697 |
Stefano Lanzavecchia | 700 |
Dan (Dyalog Ltd) | 701 |
Nick (Dyalog Ltd) | 701 |
Francesco Garue | 702 |
Jay (Dyalog Ltd) | 711 |
Kaarlo Reipas | 711 |
Алексей Коваль (Aleksei Koval) | 711 |
Kacper Gutowski | 726 |
Dragana Babić | 786 |
Zachary Taylor | 798 |
Stephen O’Brien | 823 |
Eero Kekäläinen | 954 |
Yi Lu | 1125 |
The Results
An amalgamation of all the entries showing the expressions that use the fewest characters for each number can be downloaded as a text file. Of course, there could be shorter expressions out there…
Due to APL’s versatility, many of the results can be achieved in multiple different ways – a blog post reviewing the 2016 Year Game explores some of the variations in approach.