Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

SIMPL 1.3 is out, and it's a release about learning. SIMPL now notices more of the mistakes a beginner makes, points to them the moment they happen, and explains each one in plain words, with a hint on how to fix it. It also brings new functions, and every example of the Cambridge 9618 Pseudocode Guide is now part of SIMPL's own tests.

Error messages that teach

All the messages SIMPL can give, about 250 of them, were rewritten in one style. Each says what SIMPL expected and what it found, in the words of pseudocode, and ends with a hint. A misspelled name gets a suggestion, and habits from other languages (==, !=, .5) get a friendly message of their own.

Mistakes caught early

A function called as if it were a procedure, a number passed to a BYREF parameter, a name defined twice, a date or an object used before it has a value, a REAL used as an array index: SIMPL now spots each of these where it happens and says how to put it right, so a small slip never grows into a puzzling result ten lines later. Many are found before the program even starts.

New functions

ASC and CHR convert between characters and their codes; DAY, MONTH and YEAR take a date apart; TIME() gives the seconds since the program started, the right way to keep time in a game. And Canvas.Save now writes a PNG.

And also

Routines can be called before their definition, so a program can open with its main part. A BYREF parameter is the caller's variable for the whole call, just as the manual describes it. = compares records and arrays element by element. Cambridge Strict Mode points out even more details for exam practice: accented names, guide keywords used as names, a file written with other capitals. The User Manual quotes every message exactly as SIMPL gives it, and Part III writes Canvas and Sound as programs do.

Before you upgrade

A few forms that SIMPL used to accept now get a message that says what to write instead: for example a backslash in a string is now an ordinary character, a string ends on its own line, and GETPIXEL is now called IsPainted. The full list is in the release notes below.

To upgrade, replace simpl.exe or simpl.appimage with the new one: your settings, programs and libraries are kept. Two files that come with SIMPL must be replaced, because SIMPL never overwrites them: rename programs/simplr.simpl and lib/shapes.simpl (for example to simplr_1.2.simpl), then start SIMPL 1.3, which copies the new ones in their place. It's worth doing the same for programs/tetromino_tumble.simpl and lib/structures.simpl.

Questions, ideas or bugs? Come and tell me on the SIMPL Community.


Full release notes

Compatibility. Most programs written for SIMPL 1.2.1 run unchanged in 1.3. Programs that rely on a form the guide doesn't allow, or on a detail where SIMPL used to be more lenient than the manual describes, now stop with a message that says what to write instead. None of the programs in the User Manual or in lib does any of these; for programs, see Upgrading from 1.2.1.

  • Strings. A backslash is an ordinary character: "C:\temp\new.txt" is exactly what it looks like, and "a\nb" is four characters, not two lines. A double quote inside a string is written twice, "He said ""hi""" (\" is now an error). A string must end on the line where it starts.
  • Functions and procedures. A FUNCTION called on a line of its own (Square(3), CALL Square(3), LENGTH(S)) now stops: use its result, X ← Square(3). WAIT is the exception, and is called as a procedure: CALL WAIT(0.1).
  • BYREF. The argument of a BYREF parameter must be a variable, an array element or a field: a number or an expression now stops. A BYREF parameter can't be the counter of a FOR loop.
  • Arrays. An array parameter declared with bounds (ARRAY[1:5] OF INTEGER) takes only an array with those bounds; ARRAY OF INTEGER without bounds still takes any size. An index must be an INTEGER: A[4 / 2] now stops (write A[4 DIV 2]), and so does a REAL address in SEEK.
  • Names. A name means one thing in a whole program: defining it twice, or for two different things (a variable and a procedure, a property and a method of the same class), now stops before the program runs. So does a library that defines a name the program already defines, and giving a value to the name of a routine, a class, a TYPE or an image.
  • Definitions. A PROCEDURE, FUNCTION, TYPE or CLASS can only be defined at the top level of a program (or, for routines, inside a CLASS), not inside a loop, an IF or another routine. A constructor is a PROCEDURE named NEW, not a FUNCTION. A parameter can't be DECLAREd again inside its routine.
  • Comparisons. An enumerated value is compared only with a value of its own TYPE (Spring = "Spring" now stops: write Spring), and IN only with a value of the set's type. A CASE label of another type than the value after CASE OF now stops. Records of two different TYPEs can't be assigned or compared, even with the same fields.
  • Missing values. A DATE with no value, or an object variable before NEW, now stops when its value is used (printed, joined, compared, converted), with D has no value yet or MyCat holds no object yet: create it with NEW.
  • Functions. LENGTH of a number and RAND of 0 or less now stop.
  • Graphics and sound. GETPIXEL is now called IsPainted, and works as before. The methods of Canvas and Sound that take whole numbers (coordinates, sizes, colors) no longer accept a REAL: DrawRectangle(20 / 4, ...) now stops (write 20 DIV 4). An unknown key name (KeyDown("Spcae")) now stops, suggesting the closest one. Passing too many arguments to a method now stops.
  • Numbers typed or read from a file are read as a program writes them: 1_000 or .5 now stop with Invalid input.
  • What is printed for a whole record, object, image or Canvas follows the program's own spelling: Cat(Name: "Kitty", Lives: 9), Canvas (320 x 240).
  • Error messages have new wordings, all in one style (see Error messages below).

Calling a routine before its definition, which used to stop with Undefined procedure, now works. A program of your own that uses one of the new function names (ASC, CHR, DAY, MONTH, YEAR, TIME) for its own routine or variable keeps working: your definition comes first.

Upgrading from 1.2.1

  1. Put the new simpl.exe (Windows) or simpl.appimage (Linux) in the same folder as the old one, replacing it. Your settings (simpl_settings), your programs (programs) and your libraries (lib) are next to it, and they are kept.
  2. Four files that come with SIMPL have changed, and SIMPL never overwrites a file that is already in your programs or lib folder (it might be one you changed). Rename the old ones, for example simplr.simpl to simplr_1.2.simpl, then start SIMPL 1.3: the new files are copied there at startup. Your renamed copies stay as they were.
    • programs/simplr.simpl must be replaced: the old copy stops with a syntax error in 1.3 (it uses \" in strings).
    • lib/shapes.simpl must be replaced: the old copy stops any program that IMPORTs it, because its class had a property and a method with the same name.
    • programs/tetromino_tumble.simpl and lib/structures.simpl still work, but the new copies follow the manual and the guide (Cambridge Strict Mode reports less in them) and keep Tetromino Tumble closer to real time on a slow computer.

If you put SIMPL 1.3 in a new, empty folder instead, it starts with fresh copies of everything; copy your own programs over from the old programs folder.

New functions

  • ASC(C) and CHR(N) convert between a character and its code: ASC('A') is 65, CHR(66) is 'B'.
  • DAY(D), MONTH(D) and YEAR(D) give the parts of a DATE as whole numbers.
  • TIME() gives the seconds since the program started, as a REAL: the way to measure time in a game or an animation (Now ← TIME(), Elapsed ← Now - Last). The time spent paused in the debugger doesn't count.
  • Canvas.Save writes a PNG when the name ends in .png, which every image viewer opens.

These are SIMPL extensions: Cambridge Strict Mode points them out.

The Cambridge guide, in every detail

  • Every example of the guide is now part of SIMPL's own tests, copied as the guide prints it, and gives the guide's result. Only one stops, as it should: the example of section 10.1 that calls a PRIVATE method from outside its class, which is what PRIVATE forbids.
  • CALL Beep without brackets, as the guide's own CASE example writes it, calls a procedure with no parameters.
  • Routines and classes can be used before their definition, as in Java or Visual Basic: a program can put its main part first and its routines after.
  • A BYREF parameter is the caller's variable for the whole call, as the manual explains it (and as Pascal's var or C++'s &): changing it changes the caller's variable at once, not only at the end of the call.
  • The counter of a FOR loop in a routine is always local to the routine, so a routine can never change the counter of the loop that called it.
  • = and <> compare records and arrays element by element: two records with the same fields are equal (they never were before).
  • A CASE range works for text and dates too: "A" TO "L" :.
  • The built-in functions are names, as in Python or Pascal: a variable, field or method can be called Left or Length.

Cambridge Strict Mode

Strict Mode now also reports: a name with accented letters; a keyword of the guide used as a name (Length, Step); the same file written with other capitals ("Scores.txt", "scores.txt"); LENGTH of an array; = and <> between whole arrays or records; a REAL written 5.; DECLARE for a property of a CLASS (the guide writes PRIVATE Name : STRING); CASE OF followed by an expression; RAND of a REAL; CALL without brackets; a double quote doubled inside a string.

Error messages

Every message SIMPL can give, about 250 of them, was reviewed and rewritten in one style:

  • each says what was expected and what was found, in SIMPL's own words, without Python terms such as bool or identifier;
  • names are written as in your program, and comparisons name the types: Cannot compare an INTEGER with a STRING;
  • a misspelled name, class or method suggests the closest one: Class Canvas has no method DrawRectangel / Did you mean DrawRectangle?;
  • the forms of other languages get a message of their own: ==, !=, .5;
  • every message has a hint, and errors found before the program runs always read Syntax error on line N: the program was not run;
  • a mistake is marked where it is: in a comparison under its operator, in an IMAGE on the wrong row.

The User Manual

  • Every message it quotes is the one SIMPL now gives, and every example of Part III runs as shown.
  • Chapters 26 and 27 are now Canvas and Sound, and Part III writes them as programs do: DECLARE Screen : Canvas, Screen.SetColor(255, 0, 0), without CALL before a method.
  • Chapter 26 explains TIME, and Chapters 27 and 30 use it to keep time.
  • The manual follows only the Cambridge 9618 Pseudocode Guide 2027-2029, and Appendix H no longer describes the exam papers.
  • Meet GU{I}DE is easier to read, with the menus as a list.
  • A bookmark on Chapter 26, Chapter 27 or a step of Chapter 24 now opens the manual at its start, because their titles changed.

The IDE

  • The Variables panel writes names as your program does, tells a CHAR ('K') from a STRING, shows an object's properties on its row, and leaves an empty value for a DATE or an object that has none.
  • Every built-in function is colored as a keyword where it is called, and written in capitals as you type it (length(s) becomes LENGTH(s)), while a variable called Length keeps the look of a name.

Fixed

  • A date the calendar doesn't have (31/02/2020) closed the run without a message.
  • An array bound that isn't a whole number gave an internal error.
  • A class inheriting from Canvas or Sound gave an internal error; one inheriting from a class that doesn't exist was accepted.
  • A PROCEDURE method used as a value gave NULL in silence.
  • A mistake on the first word of a program was reported differently from every other syntax error.
  • An IMAGE row written without quotes was reported on the line above, with a garbled message.