CellArray format and UnrealScript generator
Posted: July 16th, 2015, 2:22 pm
The CellArray format was created to complement (and maybe replace) the RLE format due to the following perks:
The Truecells lists the locations with alive cells inside the Size=x,y bounding box, the optional Falsecells list the locations which are not. Falsecells is used when Size is not informed (i.e. Size=*,*).
In XML it would look like that:
You can even group patterns in XML to make the called "pattern collection" for many multi-pattern purposes.
I also built a UnrealScript program (in GitHub) which implements CellArray in UnrealScript and, according to description, "emphasizes the UnrealScript 1.0's added compatibility to CellArray-coded patterns using structs".
The name suggests it converts from some other format to CellArray, because my initial project was an RLE to CellArray converter, but seeing the difficulty on it, decided just to make an app with some functions to do what was said above.
- -Compatible to C-branch languages like UnrealScript due to the implementation of variables;
-Resembles XML and can be converted to it;
-Easy to be written by other scripts, in XML or original format;
-Occupies more space, but who cares?
Code: Select all
CellArray1.0(Name=Glider Discoverer=* DiscoverYear=1980 TopLeft=-1,1 Size=3,3)
{
truecells=(X2Y3,X1Y2,X1Y1,X2Y1,X3Y1,), falsecells=(X1Y3,X3Y3,X2Y2,X3Y2)
}
In XML it would look like that:
Code: Select all
<CellArray version="1.0" name="Glider" discoverer="*" discoveryear="1980" topleft="-1,1" size="3,3">
<truecells locations="X2Y3, X1Y2, X1Y1, X2Y1, X3Y1" />
<falsecells locations="X3Y1, X3Y3, X2Y2, X3Y2" />
</CellArray>
I also built a UnrealScript program (in GitHub) which implements CellArray in UnrealScript and, according to description, "emphasizes the UnrealScript 1.0's added compatibility to CellArray-coded patterns using structs".
The name suggests it converts from some other format to CellArray, because my initial project was an RLE to CellArray converter, but seeing the difficulty on it, decided just to make an app with some functions to do what was said above.