Saturday, 17 November 2012


Rewriting rules:

Input string:

Output string:

Amandine is a string-rewriting system.

The input given is rewritten accoding to the specified rules. This is how the process goes:
The first rule is applied repeatedly to the string until no more changes are made. Then the second rule is applied, followed by the third and so on. This process is repeated until the string can not be modified with any of the rules anymore. Rules are of the form source -> replacement where source is a JavaScript regular expression and replacement is a normal string. Lines that start with a ; are ignored.

The default example shows how sorting a sequence of numbers is possible.


  1. Pai atunci pentru regulile:

    12 -> 21
    21 -> 12

    si sirul:


    ar trebui ciclu infinit.

    Or, nu-i asa.

    1. Corect, numai ca se opreste dupa 10000 de computatii. M-am gandit si la oameni ca tine