SystemFreak - System Wright's Guide

Getting tired of playing the sytems over and over? Want to give your friends a real challenge? Want to contribute to the SystemFreak community? Want to be the coolest guy on the block? No better way to do it than writing your own systems. It isn't hard. You don't need to know how to program computers. All you need is the english language and a couple of idle braincells. By the way, this document can seem a bit long, but when you read it you will find it is quite a bit you can skip, depending on your background.


A system consists of a set of rules, plus some information about the system. Every system is written in a separate file. Systems are put into the "systems"-directory, below the directory where you saved SystemFreak. To make a new system, either copy one of the files in that directory and modify it, or write one from scratch. Name your file somehing that doesn't reveal what the system is, and append ".freak" at the end. Then save it in the directory. Your system now has the same chance as every other to appear in the game. In the future I will add a choser so you can specify a system you wish to play.

A dissection of a .freak-file

I will use a pretty simple system as an example, and explain all the fields in the file. Please make sure that follow the syntax excatly. Remeber, computers are really stupid, and can only do exactly what they are told. First I present you with an example, you will find the dissection below.

  1. Description: Every third card must be a face card
  2. Play 2 cards
  3. Difficulty is 1
  4. Author is Anders Schau Knatten
  5. Email is
  6. if card1 is a face card then card must not be a face card
  7. if card1 is not a face card and card2 is a face card then card must not be a face card
  8. if card1 is not a face card and card2 is not a face card then card must be a face card

Here is the explanation. Words written in capital letters are supposed to be filled in by you. Words or letters enclosed in [] are optional.

  1. This is a description of the game. This is displayed for the user when she manages to get rid of all her cards. Syntax:
    Description: DESCRIPTION
  2. This tells the computer how many cards it is to put on the table when the game starts. Syntax:
    Play NUMBER card[s]
  3. This says how difficult the system is supposed to be. See below for examples. In future versions, it should be possible to limit the difficulty-level for a game. Syntax:
    Difficulty is NUMBER
  4. Hey, this is you! Put your name, your nick, or whatever you want to be identified by here. Syntax:
    Author is YOUR NAME
  5. If you want, you can include your email-address. It is always nice to get an email from someone on the other side of the world telling you your system was great fun! Syntax:
    Email is YOUR EMAIL
  6. The rest of the file is the rules that builds the system. I have given them a separate section.

Examples of difficulty-levels

Use this as a guideline when setting the difficulty-level on your own systems. An please remember, what seems easy to you probably isn't for someone who has no idea what the system is.

1Every other card must be red, the others must be black
2Following a face card you must play an odd card. Otherwise play an even card.
3Your card must be lower than the sum of the previous two cards.
4Following a red face card or a black non-face card, you must play an odd card. Otherwise, play even cards.
5If the sum of the previous two cards is odd and the card you are about to play is red, then it must be odd. Otherwise it must be even.
6If the previous card and the one two cards further back are both red, and the one in the middle is odd, then your card must be lower than seven. Otherwise it must be higher or equal
beyondI am sure someone will be crazy enough to tink of other weirder systems, feel free to use higher numbers for those.

Syntax for rules

The real hardcore description of valid syntax for rules is described in the section "BNF" below, but this might be a bit hard to comprehend. The easiest way to learn how to write new rules is probably to look at rules written by others. Then consult the BNF-section when you wonder about something specific. Just make sure you don't run off reading all the systems before you have played them, it will ruin the fun! I provide some examples of conditions and requirements here that you can use instead of reading actual systems:

In the rules "card" (without a number) refers to the card that is about to be played. "card1" refers to the last card on the table, "card2" to the one next to that, etc. Also note that each rule is built by a set of conditions and one requirement, like this: "if CONDITIONS then REQUIREMENT".



BNF-notation for a rule

You might not be familiar with BNF-notation. It is short for Backus-Naur form, and is a metasyntax used to express context-free grammars. Ooohh. Scary. If you just forget about that and take a look at it, it really isn't that hard. If you don't like the look of this, don't read it. Take a look at "Syntax for rules" above instead.

<rule>::=if <conditions> then <requirement>
<conditions>::=<condition>[ and <conditions>]
<colorcondition>::=<card> is <color>
<suiteconditon>::=<card> is <suite>
<facecondition>::=<card> is [not ]<face>
<odditycondition>::=<card> is <odd|even>
<valuecondition>::=<mathexpression> <comparison> <mathexpression>
<colorrequirement>::=card must be <color>
<suiterequirement>::=card must be <suite>
<facerequirement>::=card must[ not] be<face>
<oddityrequirement>::=card must be odd|even
<valuerequirement>::=<mathexpression> must[ not] be <comparison> <mathexpression>
<comparison>::=equal to|higher than|lower than
<face>::=a face card
<mathexpression>::=<card>|<number>[ +|- mathexpression]

Valid xhtml 1.0 strict and css