Class SolveRiddle20190628Task

  • All Implemented Interfaces:
    AnnotatedAntTask, AntTaskLogMethods, AntTaskMixIn, ClasspathDelegateAntTask, ConfigurableAntTask, Cloneable

    @AntTask("solve-riddle-2019-06-28")
    public class SolveRiddle20190628Task
    extends AbstractTask
    Ant Task to solve a Riddler Classic:

    From Benjamin Danard, the Superstring Scrabble Challenge:

    The game of Scrabble has 100 tiles — 98 of these tiles contain a letter and a score, and two of them are wildcards worth zero points. At home on a lazy summer day with a bag of these tiles, you decide to play the Superstring Scrabble Challenge. Using only the 100 tiles, you lay them out into one long 100-letter string of your choosing. You look through the string. For each word you find, you earn points equal to its score. Once you find a word, you don’t get any points for finding it again. The same tile may be used in multiple, overlapping words. So ‘“theater” includes “the,” “heat,” “heater,” “eat,” “eater,” “ate,” etc.

    The super challenge: What order of tiles gives you the biggest score? (The blank tiles are locked into the letter they represent once you’ve picked it.)

    The winner, and inaugural Wordsmith Extraordinaire of Riddler Nation, will be the solver whose string generates the most points. You should use this word list to determine whether a word is valid.

    For reference, this is the distribution of letter tiles in the bag, by their point value:

    0: ?×2
    1: E×12 A×9 I×9 O×8 N×6 R×6 T×6 L×4 S×4 U×4
    2: D×4 G×3
    3: B×2 C×2 M×2 P×2
    4: F×2 H×2 V×2 W×2 Y×2
    5: K
    8: J X
    10: Q Z
    
    <solve-riddle-2019-06-28 classname="String" classpathref="Reference" description="String" taskname="String">
      <classpath .../>
    </solve-riddle-2019-06-28>
    

    The submitted solution:

    CARBOXYMETHYLCELLULOSEHAND_RAFTSMANS_IPWIREDRAWERDINITROBENZENEPETTIFOGGINGJUDOKAEQUATEVIVAAIOESOOIU 912
                              C         H
    ----------------------------------------------------------------------------------------------------
    CARBOXYMETHYLCELLULOSE                                                                               46
    CARBO                                                                                                9
    CARB                                                                                                 8
    CAR                                                                                                  5
     ARB                                                                                                 5
     AR                                                                                                  2
       BOXY                                                                                              16
       BOX                                                                                               12
       BO                                                                                                4
        OXY                                                                                              13
        OX                                                                                               9
           METHYLCELLULOSE                                                                               25
           METHYL                                                                                        14
           METH                                                                                          9
           MET                                                                                           5
           ME                                                                                            4
            ETHYL                                                                                        11
            ETH                                                                                          6
            ET                                                                                           2
             THY                                                                                         9
                 CELLULOSE                                                                               11
                 CELL                                                                                    6
                 CEL                                                                                     5
                  ELL                                                                                    3
                  EL                                                                                     2
                      LOSE                                                                               4
                      LO                                                                                 2
                       OSE                                                                               3
                       OS                                                                                2
                         EH                                                                              5
                          HANDCRAFTSMANSHIP                                                              26
                          HANDCRAFTSMAN                                                                  21
                          HANDCRAFTS                                                                     16
                          HANDCRAFT                                                                      15
                          HAND                                                                           8
                          HA                                                                             5
                           AND                                                                           4
                           AN                                                                            2
                              CRAFTSMANSHIP                                                              18
                              CRAFTSMAN                                                                  13
                              CRAFTS                                                                     8
                              CRAFT                                                                      7
                               RAFTSMAN                                                                  13
                               RAFTS                                                                     8
                               RAFT                                                                      7
                                AFT                                                                      6
                                    MANS                                                                 6
                                    MAN                                                                  5
                                    MA                                                                   4
                                       SHIP                                                              5
                                       SH                                                                1
                                        HIP                                                              4
                                        HI                                                               1
                                           WIREDRAWER                                                    17
                                           WIREDRAW                                                      15
                                           WIRED                                                         9
                                           WIRE                                                          7
                                            IRED                                                         5
                                            IRE                                                          3
                                             REDRAWER                                                    12
                                             REDRAW                                                      10
                                             RED                                                         4
                                             RE                                                          2
                                              ED                                                         3
                                               DRAWER                                                    10
                                               DRAW                                                      8
                                                RAWER                                                    8
                                                RAW                                                      6
                                                 AWE                                                     6
                                                 AW                                                      5
                                                  WE                                                     5
                                                   ER                                                    2
                                                     DINITROBENZENE                                      26
                                                     DINITRO                                             8
                                                     DIN                                                 4
                                                      IN                                                 2
                                                       NITROBENZENE                                      23
                                                       NITRO                                             5
                                                       NIT                                               3
                                                        IT                                               2
                                                          ROBE                                           6
                                                          ROB                                            5
                                                           OBE                                           5
                                                            BENZENE                                      18
                                                            BEN                                          5
                                                            BE                                           4
                                                             EN                                          2
                                                                 NE                                      2
                                                                   PETTIFOGGING                          20
                                                                   PETTIFOG                              14
                                                                   PETTI                                 7
                                                                   PET                                   5
                                                                   PE                                    4
                                                                      TI                                 2
                                                                       IF                                5
                                                                        FOGGING                          13
                                                                        FOG                              7
                                                                           GIN                           4
                                                                               JUDOKA                    18
                                                                               JUDO                      12
                                                                                UDO                      4
                                                                                 DO                      3
                                                                                  OKA                    7
                                                                                   KA                    6
                                                                                    AE                   2
                                                                                     EQUATE              15
                                                                                      QUATE              14
                                                                                      QUA                12
                                                                                        ATE              3
                                                                                        AT               2
                                                                                           VIVA          10
                                                                                               AI        2
                                                                                                 OE      2
                                                                                                   SO    2
    
    Author:
    Allen D. Ball