Skip to content

Commit 83267d8

Browse files
committed
337 probs, added human_eval puzzles and changed taint_date to add_date
1 parent 632b1c6 commit 83267d8

File tree

8 files changed

+5677
-4129
lines changed

8 files changed

+5677
-4129
lines changed

generators/ICPC.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class BiPermutations(PuzzleGenerator):
1515
[ICPC 2019 Problem A: Azulejos](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
1616
which is 2,287 characters.
1717
"""
18-
taint_date = [2019, 3, 31]
1918

2019
@staticmethod
2120
def sat(perms: List[List[int]],
@@ -83,7 +82,6 @@ class OptimalBridges(PuzzleGenerator):
8382
[ICPC 2019 Problem B: Bridges](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
8483
which is 3,003 characters.
8584
"""
86-
taint_date = [2019, 3, 31]
8785

8886
@staticmethod
8987
def sat(indices: List[int],
@@ -195,7 +193,6 @@ class CheckersPosition(PuzzleGenerator):
195193
196194
Nobody solved this problem during the competition -- it is pretty difficult!
197195
"""
198-
taint_date = [2019, 3, 31]
199196

200197
@staticmethod
201198
def sat(position: List[List[int]], transcript=[[[3, 3], [5, 5], [3, 7]], [[5, 3], [6, 4]]]):
@@ -444,7 +441,6 @@ class MatchingMarkers(PuzzleGenerator):
444441
445442
This is trivial in quadratic time, but the challenge is to solve it quickly (i.e., linear time).
446443
"""
447-
taint_date = [2019, 3, 31]
448444

449445
@staticmethod
450446
def sat(cut_position: int, ring="yRrsmOkLCHSDJywpVDEDsjgCwSUmtvHMefxxPFdmBIpM", lower=5):

generators/IMO.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class ExponentialCoinMoves(PuzzleGenerator):
2121
Inspired by [IMO 2010 Problem 5](https://www.imo-official.org/problems.aspx)"""
2222

2323
multiplier = 10 # worth 10 times normal so that it can run 10 times longer than normal
24-
taint_date = [2010, 7, 2]
2524

2625
@staticmethod
2726
def sat(states: List[List[int]], n=16385):
@@ -104,9 +103,6 @@ class NoRelativePrimes(PuzzleGenerator):
104103
theorem?
105104
"""
106105

107-
taint_date = [2016, 7, 1]
108-
109-
110106
@staticmethod
111107
def sat(nums: List[int], b=7, m=6):
112108
"""
@@ -188,8 +184,6 @@ class FindRepeats(PuzzleGenerator):
188184
Inspired by [IMO 2017 Problem 1](https://www.imo-official.org/problems.aspx)
189185
"""
190186

191-
taint_date = [2017, 7, 12]
192-
193187
@staticmethod
194188
def sat(indices: List[int], a0=123):
195189
"""
@@ -237,8 +231,6 @@ class PickNearNeighbors(PuzzleGenerator):
237231
238232
The puzzle solution follows the judge's proof closely."""
239233

240-
taint_date = [2017, 7, 12]
241-
242234
@staticmethod
243235
def sat(keep: List[bool], heights=[10, 2, 14, 1, 8, 19, 16, 6, 12, 3, 17, 0, 9, 18, 5, 7, 11, 13, 15, 4]):
244236
"""
@@ -266,7 +258,7 @@ def sat(keep: List[bool], heights=[10, 2, 14, 1, 8, 19, 16, 6, 12, 3, 17, 0, 9,
266258
return all(abs(pi[2 * i] - pi[2 * i + 1]) == 1 for i in range(n))
267259

268260
@staticmethod
269-
def sol(heights): # Based on the judge's solution.
261+
def sol(heights): # Based on the judge's solution.
270262
n = int(len(heights) ** 0.5)
271263
assert sorted(heights) == list(range(n * (n + 1)))
272264
groups = [h // (n + 1) for h in heights]
@@ -301,8 +293,6 @@ class FindProductiveList(PuzzleGenerator):
301293
Inspired by [IMO 2010 Problem 5](https://www.imo-official.org/problems.aspx)
302294
"""
303295

304-
taint_date = [2010, 7, 2]
305-
306296
@staticmethod
307297
def sat(li: List[int], n=18):
308298
"""
@@ -334,8 +324,6 @@ def gen(self, target_num_instances):
334324
class HalfTag(PuzzleGenerator):
335325
"""Inspired by [IMO 2020 Problem 3](https://www.imo-official.org/problems.aspx)"""
336326

337-
taint_date = [2020, 9, 19]
338-
339327
@staticmethod
340328
def sat(li: List[int], tags=[3, 0, 3, 2, 0, 1, 0, 3, 1, 1, 2, 2, 0, 2, 1, 3]):
341329
"""
@@ -424,6 +412,5 @@ def gen_random(self):
424412
self.add(dict(tags=tags))
425413

426414

427-
428415
if __name__ == "__main__":
429416
PuzzleGenerator.debug_problems()

generators/algebra.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77
# See https://github.com/microsoft/PythonProgrammingPuzzles/wiki/How-to-add-a-puzzle to learn about adding puzzles
88

9-
class AlgebraGen:
10-
blah = 17
11-
taint_date = [2021, 4, 26]
129

13-
14-
15-
class QuadraticRoot(AlgebraGen, PuzzleGenerator):
10+
class QuadraticRoot(PuzzleGenerator):
1611
"""See [quadratic equations](https://en.wikipedia.org/wiki/Quadratic_formula)"""
1712

1813
@staticmethod

0 commit comments

Comments
 (0)