Tile Sets

Here we provide some example tile sets:
8 Tiles, 4x4 Subtiles, 1 Rule, 64 Base Points
8 Tiles, 4x4 Subtiles, 1 Rule, 512 Base Points
8 Tiles, 4x4 Subtiles, 1 Rule, 2048 Base Points Use this one

Please have a look at our source code to see how to use these tile sets.

The tile sets can be read in by the following code:
struct Tile
{
	int n, e, s, w;
	int numSubtiles, numSubdivs, numPoints, numSubPoints;
	int ** subdivs;
	Vec2 * points, * subPoints;
};

int numTiles, numSubtiles, numSubdivs;


void loadTileSet(const char * fileName)
{
	FILE * fin = fopen(fileName, "rb");
	
	numTiles = freadi(fin);
	numSubtiles = freadi(fin);
	numSubdivs = freadi(fin);

	tiles = new Tile[numTiles];

	for (int i = 0; i < numTiles; i++)
	{
		tiles[i].n = freadi(fin);
		tiles[i].e = freadi(fin);
		tiles[i].s = freadi(fin);
		tiles[i].w = freadi(fin);

		tiles[i].subdivs = new int * [numSubdivs];
		for (int j = 0; j < numSubdivs; j++)
		{
			int * subdiv = new int[sqri(numSubtiles)];
			for (int k = 0; k < sqri(numSubtiles); k++)
				subdiv[k] = freadi(fin);
			tiles[i].subdivs[j] = subdiv;
		}

		tiles[i].numPoints = freadi(fin);
		tiles[i].points = new Vec2[tiles[i].numPoints];
		for (int j = 0; j < tiles[i].numPoints; j++)
		{
			tiles[i].points[j].x = freadf(fin);
			tiles[i].points[j].y = freadf(fin);
			freadi(fin);freadi(fin);freadi(fin);freadi(fin);
		}

		tiles[i].numSubPoints = freadi(fin);
		tiles[i].subPoints = new Vec2[tiles[i].numSubPoints];
		for (int j = 0; j < tiles[i].numSubPoints; j++)
		{
			tiles[i].subPoints[j].x = freadf(fin);
			tiles[i].subPoints[j].y = freadf(fin);
			freadi(fin);freadi(fin);freadi(fin);freadi(fin);
		}
	}
	
	fclose(fin);
}