diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-02 00:33:10 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-02 00:33:10 (GMT) |
| commit | f5dd32b284fd311dd58070b6f431ec535fa93387 (patch) | |
| tree | 73de79c18b3a91e72ebdb8520694ed7fd57c5999 /src/simulation/SimulationData.cpp | |
| parent | f86091d421989ead46940cc12b77e48cfb127608 (diff) | |
| download | powder-f5dd32b284fd311dd58070b6f431ec535fa93387.zip powder-f5dd32b284fd311dd58070b6f431ec535fa93387.tar.gz | |
Working GOL (No graphics
Diffstat (limited to 'src/simulation/SimulationData.cpp')
| -rw-r--r-- | src/simulation/SimulationData.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index 6b19727..9ec5e67 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -8,6 +8,78 @@ #include "ElementFunctions.h" #include "ElementGraphics.h" +gol_menu * LoadGOLMenu(int & golMenuCount) +{ + gol_menu golMenu[NGOL] = + { + {"GOL", PIXPACK(0x0CAC00), 0, "Game Of Life B3/S23"}, + {"HLIF", PIXPACK(0xFF0000), 1, "High Life B36/S23"}, + {"ASIM", PIXPACK(0x0000FF), 2, "Assimilation B345/S4567"}, + {"2x2", PIXPACK(0xFFFF00), 3, "2x2 B36/S125"}, + {"DANI", PIXPACK(0x00FFFF), 4, "Day and Night B3678/S34678"}, + {"AMOE", PIXPACK(0xFF00FF), 5, "Amoeba B357/S1358"}, + {"MOVE", PIXPACK(0xFFFFFF), 6, "'Move' particles. Does not move things.. it is a life type B368/S245"}, + {"PGOL", PIXPACK(0xE05010), 7, "Pseudo Life B357/S238"}, + {"DMOE", PIXPACK(0x500000), 8, "Diamoeba B35678/S5678"}, + {"34", PIXPACK(0x500050), 9, "34 B34/S34"}, + {"LLIF", PIXPACK(0x505050), 10, "Long Life B345/S5"}, + {"STAN", PIXPACK(0x5000FF), 11, "Stains B3678/S235678"}, + {"SEED", PIXPACK(0xFBEC7D), 12, "B2/S"}, + {"MAZE", PIXPACK(0xA8E4A0), 13, "B3/S12345"}, + {"COAG", PIXPACK(0x9ACD32), 14, "B378/S235678"}, + {"WALL", PIXPACK(0x0047AB), 15, "B45678/S2345"}, + {"GNAR", PIXPACK(0xE5B73B), 16, "B1/S1"}, + {"REPL", PIXPACK(0x259588), 17, "B1357/S1357"}, + {"MYST", PIXPACK(0x0C3C00), 18, "B3458/S05678"}, + {"LOTE", PIXPACK(0xFF0000), 19, "Behaves kinda like Living on the Edge S3458/B37/4"}, + {"FRG2", PIXPACK(0x00FF00), 20, "Like Frogs rule S124/B3/3"}, + {"STAR", PIXPACK(0x0000FF), 21, "Like Star Wars rule S3456/B278/6"}, + {"FROG", PIXPACK(0x00AA00), 22, "Frogs S12/B34/3"}, + {"BRAN", PIXPACK(0xCCCC00), 23, "Brian 6 S6/B246/3"} + }; + golMenuCount = NGOL; + gol_menu * golMenuT = (gol_menu*)malloc(NGOL*sizeof(gol_menu)); + memcpy(golMenuT, golMenu, NGOL*sizeof(gol_menu)); + return golMenuT; +} + +int * LoadGOLRules(int & golRuleCount) +{ + int golRules[NGOL+1][10] = + { + // 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing + {0,0,0,0,0,0,0,0,0,2},//blank + {0,0,1,3,0,0,0,0,0,2},//GOL + {0,0,1,3,0,0,2,0,0,2},//HLIF + {0,0,0,2,3,3,1,1,0,2},//ASIM + {0,1,1,2,0,1,2,0,0,2},//2x2 + {0,0,0,3,1,0,3,3,3,2},//DANI + {0,1,0,3,0,3,0,2,1,2},//AMOE + {0,0,1,2,1,1,2,0,2,2},//MOVE + {0,0,1,3,0,2,0,2,1,2},//PGOL + {0,0,0,2,0,3,3,3,3,2},//DMOE + {0,0,0,3,3,0,0,0,0,2},//34 + {0,0,0,2,2,3,0,0,0,2},//LLIF + {0,0,1,3,0,1,3,3,3,2},//STAN + {0,0,2,0,0,0,0,0,0,2},//SEED + {0,1,1,3,1,1,0,0,0,2},//MAZE + {0,0,1,3,0,1,1,3,3,2},//COAG + {0,0,1,1,3,3,2,2,2,2},//WALL + {0,3,0,0,0,0,0,0,0,2},//GNAR + {0,3,0,3,0,3,0,3,0,2},//REPL + {1,0,0,2,2,3,1,1,3,2},//MYST + {0,0,0,3,1,1,0,2,1,4},//LOTE + {0,1,1,2,1,0,0,0,0,3},//FRG2 + {0,0,2,1,1,1,1,2,2,6},//STAR + {0,1,1,2,2,0,0,0,0,3},//FROG + {0,0,2,0,2,0,3,0,0,3},//BRAN + }; + golRuleCount = NGOL+1; + int * golRulesT = (int*)malloc((golRuleCount*10)*sizeof(int)); + memcpy(golRulesT, golRules, (golRuleCount*10)*sizeof(int)); + return golRulesT; +} + wall_type * LoadWalls(int & wallCount) { wall_type wtypes[] = |
