This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
boards:diatoms:diatoms [2016/01/14 00:10] Ozyman old revision restored (2016/01/10 23:26) |
boards:diatoms:diatoms [2016/01/15 00:21] Ozyman |
||
---|---|---|---|
Line 29: | Line 29: | ||
Locked to medium fog. All territories have view borders to up to 3 territories away. Vision is blocked by non-triangle diatoms. | Locked to medium fog. All territories have view borders to up to 3 territories away. Vision is blocked by non-triangle diatoms. | ||
+ | |||
+ | ===== Cards ===== | ||
+ | Start with a wild card - hold up to six. If you hang on to your wild card, you'll always be able to turn in twice with six cards. | ||
Line 69: | Line 72: | ||
====== Development ====== | ====== Development ====== | ||
- | blah blah.. wiki lost my text... | + | I've often had difficulty making boards with abandon that I was happy with. It usually seemed to encourage very aggressive behavior, and lots of empty territories. |
+ | |||
+ | The ' | ||
<code python> | <code python> | ||
def setupDiatoms(): | def setupDiatoms(): | ||
wgmap = WGMap() | wgmap = WGMap() | ||
wgmap.loadMapFromFile('// | wgmap.loadMapFromFile('// | ||
+ | |||
+ | # get territory sets | ||
triangleTerritories = wgmap.getTerritoryIDsFromNameRegex(" | triangleTerritories = wgmap.getTerritoryIDsFromNameRegex(" | ||
rhombusTerritories = wgmap.getTerritoryIDsFromNameRegex(" | rhombusTerritories = wgmap.getTerritoryIDsFromNameRegex(" | ||
hexagonTerritories = wgmap.getTerritoryIDsFromNameRegex(" | hexagonTerritories = wgmap.getTerritoryIDsFromNameRegex(" | ||
+ | | ||
+ | # add continents | ||
wgmap.continentsFromNeighbors(triangleTerritories, | wgmap.continentsFromNeighbors(triangleTerritories, | ||
wgmap.continentsFromNeighbors(rhombusTerritories, | wgmap.continentsFromNeighbors(rhombusTerritories, | ||
Line 87: | Line 96: | ||
- | | + | |
- | # I think this version | + | |
- | | + | |
def getATWNB(territoryID, | def getATWNB(territoryID, | ||
| | ||
- | #import pdb; | ||
tid = int(territoryID) | tid = int(territoryID) | ||
- | # | ||
borderDepth = 0 | borderDepth = 0 | ||
allTerritoriesInReach = set() | allTerritoriesInReach = set() | ||
allTerritoriesInReach.add(tid) | allTerritoriesInReach.add(tid) | ||
nBorders = int(nBorders) | nBorders = int(nBorders) | ||
- | #print " | ||
- | #print " | ||
- | #print " | ||
| | ||
while(borderDepth < nBorders): | while(borderDepth < nBorders): | ||
allTerritoriesAddition = set() | allTerritoriesAddition = set() | ||
- | #print " | ||
for tirID in allTerritoriesInReach: | for tirID in allTerritoriesInReach: | ||
tirName = wgmap.getTerritoryNameFromID(tirID) | tirName = wgmap.getTerritoryNameFromID(tirID) | ||
- | #print " | ||
if tirName[0] != " | if tirName[0] != " | ||
- | #print " | ||
continue; | continue; | ||
tb = wgmap.getNeighborIDsFromID(tirID, | tb = wgmap.getNeighborIDsFromID(tirID, | ||
- | #tb = self.getBorderTerritoryIDsByTerritoryID(tirID, | ||
- | #print " | ||
- | #if len(tb) > 8: | ||
- | # pdb.set_trace() | ||
allTerritoriesAddition |= set(tb) | allTerritoriesAddition |= set(tb) | ||
allTerritoriesInReach |= allTerritoriesAddition | allTerritoriesInReach |= allTerritoriesAddition | ||
borderDepth = borderDepth + 1 | borderDepth = borderDepth + 1 | ||
- | #print " | ||
- | | ||
- | # | ||
- | print " | ||
- | print "######################## | ||
- | | ||
- | #if len(allTerritoriesInReach) > 72: | ||
- | # pdb.set_trace() | ||
return allTerritoriesInReach | return allTerritoriesInReach | ||
- | | + | |
+ | | ||
nDistance=3 | nDistance=3 | ||
- | #baseRegex = " | ||
targetRegex=" | targetRegex=" | ||
directionality=" | directionality=" | ||
- | ''' | + | |
- | An nDistance of 1 does nothing... | + | |
- | ''' | + | |
setrecursionlimit(15000) | setrecursionlimit(15000) | ||
originalDOM = deepcopy(wgmap.DOM) | originalDOM = deepcopy(wgmap.DOM) | ||
Line 145: | Line 131: | ||
| | ||
for t in wgmap.DOM.getElementsByTagName(" | for t in wgmap.DOM.getElementsByTagName(" | ||
- | #if (None == re.search(baseRegex, | ||
- | # continue | ||
tid = t.getAttribute(" | tid = t.getAttribute(" | ||
- | #print " | ||
| | ||
wgmap.DOM = originalDOM | wgmap.DOM = originalDOM | ||
+ | # find all territories that should be viewable from t | ||
twoDist = getATWNB(tid, | twoDist = getATWNB(tid, | ||
| |