Knuckle Cracker

Creeper World 3 => Custom Map Discussion => Colonial Space Map Discussion => Topic started by: AutoPost on April 15, 2019, 02:53:37 PM

Title: Custom Map #7302: First map on mplLang. By: Arin112
Post by: AutoPost on April 15, 2019, 02:53:37 PM
This topic is for discussion of map #7302: First map on mplLang
(http://knucklecracker.com/creeperworld3/queryMaps.php?query=thumbnailid&id=7302)

Author: Arin112
Size: 128x84

Desc:
Not so long ago I released mplLang v0.26. This is a language that was created to facilitate the writing of CRPL code for maps in CW3. Check out the forum post for details.
Title: Re: Custom Map #7302: First map on mplLang. By: Arin112
Post by: Arin112 on April 15, 2019, 03:01:09 PM
You can find the source code, download link fow windows and mpl examples here (https://github.com/Arin112/mplLang).
The source code of the emitter for this map is here (mpl (https://github.com/Arin112/mplLang/blob/master/examples/emitter.mpl)/CRPL (https://github.com/Arin112/mplLang/blob/master/examples/emitter.crpl)).
And for the map generator here (mpl (https://github.com/Arin112/mplLang/blob/master/examples/emitter.mpl)/ CRPL (https://github.com/Arin112/mplLang/blob/master/examples/emitter.crpl)).
The basic idea is that you write the code for mplLang, then compile and then use the CRPL code that the compiler generates.

Currently the language supports
1. Operators =, +, -, /, *, $ (concatenation), ==, !=, <, >, <=, >=, - (unary), ^ (power), +=, -=, *=, /=, %=, $=, || (or), && (and).
2. Ternary operator ? :
3. Multi assigment [x, y] = CurrentCoords();
4. All functions from CRPL.
5. Some additional functions : stack() for read from stack, refRead - "<-!", refWrite - "->!", refExists - "-?!", refDelete - "--?", exists - "-?", delete - "--";
6. Expressions - for(i=0;i<10;i+=10), do(nTimes), do(0 .. 11), while(cond), once, if()else.
7. Function definition. Functions may have additional attributes - inline (main function must be inline, all calls of inline function will be implaces by it body ) and CRPL(body of CRPL function is just CRPL code).

If you have any questions, suggestions, remarks, bugs, etc. you can drop them here or to my private messages in Discord (Arin112#8343) or here http://github.com/Arin112/mplLang/issues