Ejemplo n.º 1
0
 def test_get_crossing_words(self):
     grid = TestGrid.get_good_grid()
     puzzle = Puzzle(grid)
     # 20 across is crossed by:
     # 3 down, 14 down, 21 down, 4 down, and 5 down
     expected = [3, 14, 21, 4, 5]
     across_word = puzzle.get_across_word(20)
     actual = [word.seq for word in across_word.get_crossing_words()]
     self.assertListEqual(expected, actual)
Ejemplo n.º 2
0
    def create_nyt_daily():
        """ from https://www.nytimes.com/crosswords/game/daily/2016/09/20 """
        grid = Grid(15)
        for r, c in [(1, 5), (1, 11), (2, 5), (2, 11), (3, 5), (3, 11),
                     (4, 14), (4, 15), (5, 7), (5, 12), (6, 1), (6, 2), (6, 3),
                     (6, 8), (6, 9), (7, 4), (8, 5), (8, 6), (8, 10), (8, 11),
                     (11, 4)]:
            grid.add_black_cell(r, c)
        puzzle = Puzzle(grid)
        for seq, text in [(1, "ACTS"), (5, "PLASM"),
                          (10, "EDGY"), (14, "SHIV"), (15, "RUCHE"),
                          (16, "VALE"), (17, "NINE"), (18, "USUAL"),
                          (19, "IRON"), (20, "ENGLISHTRIFLE"), (23, "RASTAS"),
                          (24, "EDNA"), (25, "WAS"), (28, "EMIT"),
                          (30, "DIGEST"), (32, "MAY"), (35, "BAKEDALASKA"),
                          (38, "ALOT"), (40, "ONO"), (41, "BAER"),
                          (42, "PLUMPUDDING"), (47, "YDS"), (48, "LESSON"),
                          (49, "TIOS"), (51, "EYE"), (52, "OHMS"),
                          (55, "CLUMSY"), (59, "NOPIECEOFCAKE"), (62, "UNDO"),
                          (64, "NAOMI"), (65, "KRIS"), (66, "SIMP"),
                          (67, "GLOMS"), (68, "EIRE"), (69, "EXES"),
                          (70, "ESTEE"), (71, "RATS")]:
            puzzle.get_across_word(seq).set_text(text)

        for seq, clue in [
            (1, "___ of the Apostles"),
            (5, "Ending with neo- or proto-"),
            (10, "Pushing conventional limits"),
            (14, "Blade in the pen"),
            (15, "Strip of fabric used for trimming"),
            (16, "Low ground, poetically"),
            (17, "Rock's ___ Inch Nails"),
            (18, "Habitual customer's order, with \"the\""),
            (19, "Clothes presser"),
            (20,
             "Layers of sherry-soaked torte, homemade custard and fruit served chilled in a giant stem glass"
             ),
            (23, "Dreadlocked ones, informally"),
            (24, "Comical \"Dame\""),
            (25, "\"Kilroy ___ here\""),
            (28, "Give off, as vibes"),
            (30, "Summary"),
            (32, "___-December romance"),
            (35,
             "Ice cream and sponge topped with meringue and placed in a very hot oven for a few minutes"
             ),
            (38, "Oodles"),
            (40, "Singer with the site imaginepeace.com"),
            (41, "Boxer Max"),
            (42,
             "Steamed-for-hours, aged-for-months concoction of treacle, brandy, fruit and spices, set afire and served at Christmas"
             ),
            (47, "Fabric purchase: Abbr."),
            (48, "Teacher's plan"),
            (49, "Uncles, in Acapulco"),
            (51, "___ contact"),
            (52, "Units of resistance"),
            (55, "Ham-handed"),
            (59,
             "What a chef might call each dessert featured in this puzzle, literally or figuratively"
             ),
            (62, "Command-Z command"),
            (64, "Actress Watts"),
            (65, "Kardashian matriarch"),
            (66, "Fool"),
            (67, "Latches (onto)"),
            (68, "Land of Blarney"),
            (69, "Ones who are splitsville"),
            (70, "Lauder of cosmetics"),
            (71, "\"Phooey!\""),
        ]:
            puzzle.get_across_word(seq).set_clue(clue)

        for seq, clue in [
            (1, "Ed of \"Up\""),
            (2, "Set traditionally handed down to an eldest daughter"),
            (3, "Tiny bell sounds"),
            (4, "Willowy"),
            (5, "German kingdom of old"),
            (6, "Growing luxuriantly"),
            (7, "Severe and short, as an illness"),
            (8, "Glass fragment"),
            (9, "Gates of philanthropy"),
            (10, "Voldemort-like"),
            (11, "\"Hesitating to mention it, but...\""),
            (12, "Mop & ___"),
            (13, "Itch"),
            (21, "da-DAH"),
            (22, "Pass's opposite"),
            (26, "\"___ and answered\" (courtroom objection)"),
            (27, "Constellation units"),
            (29, "Walloped to win the bout, in brief"),
            (31, "Chew the fat"),
            (32, "Sugar ___"),
            (33, "Locale for urban trash cans"),
            (34, "Sam Cooke's first #1 hit"),
            (36, "Come to a close"),
            (37, "\"I dare you!\""),
            (39, "Designs with ® symbols: Abbr."),
            (43, "Lowdown, in slang"),
            (44, "Drive mad"),
            (45, "Salade ___"),
            (46, "Club game"),
            (50, "Lollipop"),
            (53, "\"Square\" things, ideally"),
            (54, "\"Git!\""),
            (56, "\"West Side Story\" seamstress"),
            (57, "Mini, e.g."),
            (58, "Positive R.S.V.P.s"),
            (60, "Error report?"),
            (61, "J.Lo's daughter with a palindromic name"),
            (62, "Manipulate"),
            (63, "Kill, as an idea"),
        ]:
            puzzle.get_down_word(seq).set_clue(clue)
        return puzzle