**Introduction**

*L – A Mathemagical Adventure*(hereinafter referred to as

*L*) is a text-based single-player role-play computer game produced in 1984 by the Association of Teachers of Mathematics (ATM, no date), aimed at Key Stages 2 to 4. Originally designed to run on the BBC platform then more or less common in schools, the game is similar in format to other text-based games, such as Zork (Barton, 2007): the player has a quest – in this instance, to rescue a fair maiden named Runia; to achieve this objective, the player must overcome obstacles, defeat fearsome enemies, solve puzzles, and so forth; and the play is controlled by means of a set of relatively simple commands. Despite its single-player setup, there are opportunities for shared gameplay, discussion and co-operation in solving the puzzles presented.

**The Telephone**

The Fibonacci sequence is named after Leonardo of Pisa [1] (O’Connor & Robertson, 1998) -nbsp;undoubtedly the 13th century Italian mentioned in one of the telephone messages. It appears in his Liber Abaci, in which he also introduces place-value decimal numbers. Fibonacci came to the attention of the Holy Roman Emperor, Frederick II, and his court. He was set a series of problems, including a problem regarding rabbit populations (see Figure 2). Starting with a pair of rabbits, and assuming they mature at one month old and produce young at two months old, how many pairs of rabbits would there be at the end of any given month? Fibonacci determined that the number of pairs in any one month was equal to the sum of the pairs in the previous two months: 1, 1, 2, 3, 5, 8 being the number of pairs in each of the first six months.

Had the sequence remained in the sphere of population dynamics, it would have been of limited use: none of Fibonacci’s rabbits ever die, for example, and continue to breed unabated by considerations of food supply, or, indeed, the walls surrounding their habitat as described in the original problem. However, the sequence has found applications in such a wide arena that there is a scholarly journal, the Fibonacci Quarterly, is devoted to its academic study. An examination of the L telephone messages reveals some of the areas in which the Fibonacci sequence has been applied:

001, 377: meteorology (Swinbank & Purser, 2006);

013: botany and biology (Knott, date unknown);

089: economics (Frost & Prechter, 1998);

114: sports and betting (O’Connell, 2008).

An unusual property of the Fibonacci sequence is that, when each number in turn is divided by its predecessor, the results converge on a curious number known as ϕ (phi), or the Golden Ratio. This number is found in nature, in architecture, art, music, geometry, and visual perception; it appears to underlie our notions of beauty; and has even inspired authors such as Dan Brown. Its pervasiveness is such that some see it written by the hand of God (Meisner, date unknown).

Surprisingly then, under the circumstances, I have been unable to establish a link between Lewis Carroll’s Alice and the Fibonacci sequence, except for the rather trivial coincidence that both began with rabbits.

[1]: Leonardo was a member of the Bonacci family: Fibonacci may be a contraction of figlio Bonacci – son of Bonacci.

**The Bat Room**

The triangular numbers are one of a class of numbers known as ‘figurate’, meaning that each term can be represented as a figure: graphically as a pattern of dots, or physically using counters, bottle tops, etc., where they can be used to teach younger students about the relationships between numbers, patterns and graphical representation. Such figures are regular geometric shapes – triangles, squares, pentagons, and so forth (Weisstein, date unknown–a). The figurate numbers are widely studied in number theory, but the triangular numbers attract considerable interest as they pop up in a variety of different equations, such as the sum of consecutive integers, square numbers, Pascal’s Triangle, and even integrals (Weisstein, date unknown – b). The most famous triangle number is the infamous 666, the so-called Number of the Beast. Sadly, the true Number of the Beast according to modern Biblical scholarship is the rather less inspiring 616.

The link to Lewis Carroll’s work in this task is again somewhat tenuous. The Bat was the nickname for Bartholomew Price, a professor of mathematics at Oxford known to both Lewis Carroll and Alice Liddell, the model for Alice, and Carroll parodies a well-known nursery rhyme through the voice of the Mad Hatter:

Twinkle, twinkle, little bat

How I wonder what you’re at!

Up above the world you fly

Like a tea-tray in the sky.

Twinkle, twinkle, little bat

How I wonder what you’re at!

**The Code Room**

Dodgson was greatly interested in cryptography both recreationally and academically, and is known to have produced several ciphers, including a matrix cipher (Abeles, 2005). Some of these ciphers cunningly included nulls – non-code characters, or code characters used randomly – to disguise the meaning further. He used these codes to write letters to friends, and to remember dates.

**Baking a Cake**

Initially, I attempted to use the codebook on the ingredient names. I tried to find another code or language that might convert the letters into digits, sums, four-letter number names, ingredients with four letters (e.g., eggs or soda), or even four-letter acronyms. Finally, I tried simply putting in random numbers. More than 100g was declared ‘wasteful’ by the cook. By systematically changing one number at a time, I found a rough relationship similar to a Bell curve between the ingredients and the cake: that is, up to a point, increasing the ingredients increased the size of the cake, but beyond that, the cake decreasing in size. However, I was unable to find any distinct mathematical relationship, such as Pythagorean Triples.

Then I had a happy accident. Having found that 6g TOLT, 10g FIMA and 8g MUOT produced a 25cm cake, I decided to leave the game but forgot to save my position. When I went back in, I accidentally typed 10g MUOT instead of 8g – and it worked. After another 20 or 30 tries, I determined that 5, 6 or 7g of TOLT, 10-18g inclusive of FIMA, and 1-100g inclusive of MUOT, in any combination, produced a cake of the desired height.

It would be disappointing if this task, which must on average take players more time to complete than any other, were merely some kind of trial and error problem. I searched for more possibilities, but with little success. However, amongst the extra pieces of information I gleaned was that Dodgson had done some research on matrices, or ‘blocks’ as he called them, and had produced a method for finding determinants, known as Dodgson’s Condensation, which remains one of the most efficient to date (Dodgson, 1867). I also discovered, quite incidentally, that a contemporary of his, Sylvester, worked on the determinants of rectangular matrices (Weisstein, date unknown-c). It then occurred to me that the ingredients could be arranged into a rectangular 3 x 4 matrix of letters, with 25 perhaps representing a determinant. Unfortunately, I could go no further forward with this idea – partly because the mathematics is currently beyond me, and partly because there is still a crucial element missing: the key to the matrix. I was unsuccessful in finding a copy of Dodgson’s matrix cipher, which may be the key – assuming, of course, that I am not seeing patterns where none exist.

**Conclusion**

When drawing the map, I noticed that the palace is missing much of its ground floor. Perhaps it is a fully-working evaluation copy, missing some additional ‘levels’: some objects are of no use; some tasks are unconnected to the quest; and there are unresolved issues at the end of the game. If so, then I would love to play a full version – which is high praise indeed.

Rachel, thanks for a fascinating blogpost, which Google must only just have pushed higher up its rankings of search results, because I’ve only just found it despite having done loads of trawls for “L – A Mathemagical Adventure” a couple of years ago when I was making what I now realise is an embarrassingly dim and under-researched video-playthrough of the game!: https://www.youtube.com/watch?v=KKMeuxsvk3k&list=PLy5HwFxc67UFERGEqbKU-Ky74QwEtuLsm

If you play this game in a BBC Micro emulator, and quit while playing, you can LIST the program’s source to shed some light on how the cake puzzle works. All the spaces are removed and the variable names aren’t very helpful, but the cook’s code is on lines 6180-6280. On line 6250 we have this, where I’ve added some spacing for a bit more readability:

6250 P(4)=26-.5*((P(1)-6)^2)-.045*((P(2)-14)^2):

@%=&0102020A:

IF P(4) < 9.1 THEN PROCT(177)

ELSE PROCT(169):PROCPr(STR$(P(4))+"cm.")

So the height of the cake is given by the formula:

26 – 0.5*(TOLT – 6)^2 – 0.045*(FIMA – 14)^2

Unless this height is less than 9.1cm, in which case the game tells you it's 9cm and "doesn't seem to have risen at all".

As you found, the amount of MUOT has no effect.

However, I'm at a loss as to the significance of the names of the ingredients, if any.