Tetris in AL

In this video, I show a Tetris clone, written in AL by Gert Lynge. This started as a dare in the comment of my FinSweep video and Gert has converted an old Tetris game from Concorde XAL code to AL.

Javascript are used for the visuals, but all game logic is written in AL.

https://youtu.be/1TffEngHKRM

In this blast from the past video, Erik takes us back to 1996 to revisit what may be the very first game ever written inside Navision Financials — a Minesweeper clone called FinSweep. The story behind it involves a training seminar, a challenge from an instructor, and a young developer who decided to prove that the form designer was more powerful than anyone thought.

The Origin Story: A Challenge at a Navision Seminar

The year was 1996, and Navision Financials had just been released. Navision was holding seminars to bring developers up to speed on the new tool and all its features. At one of these seminars, the instructor — Lars Laström (who you can still find on LinkedIn) — was demonstrating the form designer. He mentioned that the team had even tried to recreate Minesweeper inside the form designer but couldn’t quite pull it off.

Erik, sitting in the audience, took that as a personal challenge. Instead of following along with the rest of the class and completing the assigned exercises, he spent the remainder of the day trying to build Minesweeper in Navision Financials. By the end of the day, he had a working version.

FinSweep: The Game

Erik cleverly “carbon dated” his creation — the game displays March 6, 1996 as its creation date. He named it FinSweep, a play on the Financials executable name (fin.exe) and Minesweeper. At the time, he was working for a company in Denmark called TAB (The Absolute Business Partner).

The game itself works much like the classic Windows Minesweeper. You click on squares in a minefield — each revealed square shows a number indicating how many mines are adjacent to it. If you click on a mine, you lose and get the message: “Let’s hope you’re better at bookkeeping!” If you manage to click on every square except the eight hard-coded mines, you win — and it’s back to bookkeeping.

How It Was Built: The Technical Trick

For the demo, Erik runs FinSweep in NAV 2009 R2, but the underlying technique is the same as in the original 1996 version. The entire game is contained in a single form.

The key insight was layering controls on top of each other. Each cell in the minefield consists of two controls stacked together:

  • A button on top (named something like T1)
  • A text box of the same size underneath (named something like K1)

This stacking was made possible by editing the form in its text export format — a feature that was relatively new at the time. The old text format existed mainly for documentation, but in Navision Financials you could actually edit the TXT format and re-import it, allowing you to precisely position a button directly on top of a text field.

The Game Logic

When a button is pushed:

  1. The button is made invisible
  2. The text box underneath is made visible, revealing the contents of that cell
  3. A CheckInput function is called with the specific control ID (e.g., control 11)

Because you couldn’t abstract controls into an array in the form designer, each button had to directly reference its corresponding control by ID. The CheckInput function then checks the minefield array (MineFelt in Danish):

  • If the array position contains an “X”, the user has hit a mine — all buttons are removed to reveal the entire minefield, and the “hope you’re better at bookkeeping” message appears
  • If it’s blank, the game calculates how many mines surround that cell and displays the count
  • If the player uncovers every safe square (all but the eight hard-coded mines), they win

Erik notes that some of the code looks archaic by modern standards — things like manual number formatting that could easily be replaced with a simple Format call — but he left it as-is for historical authenticity.

The Viral Easter Egg

FinSweep didn’t stay on one machine for long. It spread almost like a virus across Navision installations. In the old Financials main menu — before the fancy menu introduced in version 4 — there was a blue square with a turquoise-green circle in the middle. Many customers discovered that if they had a free form object not used for anything, they could click on the green circle and launch the game. It became a beloved Easter egg across numerous customer installations.

The game traveled with Erik from Denmark to the United States when he moved in the summer of 1996 or 1997, and it continued spreading to customers there as well.

From FinSweep to BC Chess

The tradition of building games inside Dynamics NAV and Business Central clearly continued over the years. The source code included with this video references a more modern project — BC Chess — built as an AL extension for Business Central:

{
  "id": "b419d778-fcf5-45ee-9914-64b957f65f8c",
  "name": "BC Chess",
  "publisher": "Hougaard.com",
  "version": "1.0.0.0",
  "platform": "17.0.0.0",
  "application": "17.0.0.0",
  "idRanges": [
    {
      "from": 57300,
      "to": 57349
    }
  ],
  "runtime": "6.0"
}

From a simple Minesweeper clone built by editing text-format form exports in 1996 to a full chess game running as a modern AL extension — it’s a testament to both the flexibility of the platform and the creativity of the developer community.

Conclusion

FinSweep stands as a remarkable piece of Navision history — likely the very first game ever written inside Navision Financials, created on a whim during a training seminar in March 1996. It demonstrated that the form designer was indeed as powerful as the instructor claimed (perhaps even more so), and it became a viral Easter egg that delighted customers across Denmark and beyond. More than just a novelty, it showcased the flexibility and hackability of the platform that developers have continued to push the boundaries of for over two decades. If you’ve ever built a game inside Navision, NAV, or Business Central, Erik wants to hear about it!