The Flexible Setup

Flexibility comes with a price: you need to take many more decisions and you need to do more work. When it comes to setting up your Alan environment (not using AlanIDE, as was described earlier) you must make two choices:

  1. Which text editor should I use?
  2. Command line or GUI?

You type Alan source code into a texteditor and save it in a text file. Your choice of text editors are plenty, from Notepad to more programmer-friendly ones. This page will help you make your long-term selection, but if you are just making a quick trial run of Alan you can get by with the text editor delivered with your platform (Notepad for Windows, TextEdit for MacOSX). Just remember to save your source code as "pure text" (and no, you can't use Wordpad, Microsoft Word or LibreOffice). The Alan compiler don't understand formatting. Steve Griffiths has also a few tips on the subject.

The GUI choice

The choice of "command line or GUI" might seem confusing to you. If so, I recommend going for the "GUI". This means that you should make sure to download the GUI-version of the complete distribution, if one is available for your platform. If there is not, you either have to settle for the command line approach or just go with AlanIDE (which is definitely not a bad choice!).

GUI-versions of the compiler and interpreter are run from your windowing environment in some manner. E.g. on Windows you can double click on the compiler, or start it from the Windows menu, and it will prompt you with a file selection dialog in which you can select which file to compile. You can even double-click on the source file and the GUI-version of the Alan compiler will compile it. After compiling, a window will be showing any possible errors, which you need to fix by editing the source code. GUI-versions of the interpreter work much the same way: start it and it will prompt you for a game to run/play.

The Command Line Choice

Going for the "command line" means that you need to open up a command line prompt to start your compiles and runs using textual commands. This might seem daunting but there are only a few that you need to use in the beginning. On Windows this means opening up a Command Prompt and navigate to the folder where your source files are. Once there, you must type "alan" (the name of the alan compiler program) followed by the name of your main source file to compile the source file into a game. Likewise, to run your game you type "arun" followed by the game name.

Difficulties of the command line approach include:

  • Harder to get installation to work smoothly
  • Interpreters don't support all features (like images and output formatting)

A middle ground is definitely to run the command line version of the compiler and the GUI-version of the interpreter or Gargoyle.

The "full Monty" of the command line setup includes:

  1. Download a complete package, command line version, from the Download Area
  2. Extract the files in that package to a folder somewhere (like C:\Program\AlanV3 on Windows)
  3. Set the path to include that folder (the "path" is a set of folders where the command line looks for the programs you ask it to run and here's some instructions on how to do that)
  4. Try the setup by opening a command prompt and type "alan -v". If it answers with something intelligible, it works.
  5. Now you can edit an Alan source file ("myfirstgame.alan") in some directory (~/IFWriting/MyFirstGame, perhaps) and try to compile it using the "alan" command
  6. If there was any errors discovered in your source code they will be displayed and you need to fix those by redoing step 5
  7. Run the created game with "arun myfirstgame"

What They Say

"I gotta say, I love it!"

Robert DeFord