aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
authorthecharlesblake2018-01-04 11:48:41 +0000
committerthecharlesblake2018-01-04 13:01:06 +0000
commite28645b3a2b610c1c95ed8f7553e336354b7d17f (patch)
tree1a7ad3510dbbc20d4cf3694abca105a9d3af2004 /benchmark.py
parentAdd legal move generation for waste pile (diff)
downloadmetasol-e28645b3a2b610c1c95ed8f7553e336354b7d17f.tar.gz
metasol-e28645b3a2b610c1c95ed8f7553e336354b7d17f.zip

Add fortunes favor to benchmark script

Diffstat (limited to 'benchmark.py')
-rw-r--r--benchmark.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/benchmark.py b/benchmark.py
index f011d64..02b9c38 100644
--- a/benchmark.py
+++ b/benchmark.py
@@ -65,6 +65,18 @@ class BakersDozenRulesGen(SolitaireRulesGen):
self.baseJson["max rank"] = level
self.baseJson["tableau piles"]["count"] = level
+class FortunesFavorRulesGen(SolitaireRulesGen):
+
+ def __init__(self):
+ super().__init__("fortunes-favor")
+
+ def alterFieldsToChange(self, level):
+ # Because aces start up we must skip lv 1
+ if (level == 1): level = 2;
+ self.baseJson["max rank"] = level
+ self.baseJson["tableau piles"]["count"] = math.ceil(12*level/13)
+ self.baseJson["stock size"] = level * 4 - 4 - self.baseJson["tableau piles"]["count"]
+
def cleanup():
os.remove(tempRulesFilename)
run("pkill solvitaire", shell=True)
@@ -75,7 +87,8 @@ atexit.register(cleanup)
for rulesGen in [SpanishPatienceRulesGen(),
FreeCellRulesGen(),
BlackHoleRulesGen(),
- BakersDozenRulesGen()]:
+ BakersDozenRulesGen(),
+ FortunesFavorRulesGen()]:
# Loops through the levels
for level in range(1, 13):