The word search puzzle below contains a secret message. To get this message, you have to find all the clue words in the puzzle (the words shown beside it) and circle them. Then you read any un-circled letters that remain from top left to bottom right to get the secret message. The clue words might appear horizontally, vertically, or diagonally. They might read forwards, backwards, downwards or upwards. Clue words can share any number of letters. Each clue word appears exactly once in the puzzle.
ADDICTIVE | DARK | PUDDING |
BAKING | DECADENT | SEMISWEET |
BARS | DELICIOUS | SUGAR |
BITTERSWEET | DESSERT | SWISS |
BROWNIES | DRINKS | SYRUP |
CAKES | FILLING | TREAT |
CANDY | FONDUE | TRUFFLES |
CHIPS | FOOD | UNSWEETENED |
CHOCOLATIERS | FUDGE | WHITE |
COCOA | ICE CREAM | |
CONFECTIONERY | ICING | |
COOKIES | INGREDIENT | |
CREAM PIE | MILK | |
CUPCAKE | MOUSSE |
In this case, the secret message is "CHOCOLATE ORIGINATES FROM THE SEEDS OF THE THEOBROAMA CACAO TREE". The locations of the words in the puzzle are shown below.
The input will contain test cases.
Each test case starts with a line containing two integers and separated by a space character. and represent the number of rows and columns in the board . This is followed by lines, each containing uppercase letters. This is the puzzle board.
The next line contains an integer representing the number of clue words and then the next lines contain one clue word each. Clue words will be written in uppercase and will contain fewer than characters, but they might contain spaces, apostrophes or other punctuation, all of which should be ignored when searching for the words on the board.
Note that the sample input below contains only a single test case, but the real data files will contain test cases, one after another, with no blank lines in between.
Word Search puzzles courtesy of |
Livewire Puzzles (https://www.puzzles.ca) |
Sample Input
17 17
KLIMTSEINWORBCHOC
CGOLYNASEMISWEETT
EHNCSDENETEEWSNUO
RCIIOENIIGFILLING
SIOPKCLADNABFTESE
KFRNSAOFCEIOOMCTV
NRHEFDBAFTRSOEHEI
ICATAERTTUIGDDOGT
RORDSNCECCRONSCNC
DOWEFTRTEUTTUIOII
GKHTASPCIRPOHFLDD
NIIEWMRUEOICOTADD
IETESEPSRCNNAHTUA
CSESAESIIYDEBKIPO
ITIMBERLEUSAROEAM
AWFUDGECEARCAYRSO
SUGARDTESSUOMRSEE
37
ADDICTIVE
BAKING
BARS
BITTERSWEET
BROWNIES
CAKES
CANDY
CHIPS
CHOCOLATIERS
COCOA
CONFECTIONERY
COOKIES
CREAM PIE
CUPCAKE
DARK
DECADENT
DELICIOUS
DESSERT
DRINKS
FILLING
FONDUE
FOOD
FUDGE
ICE CREAM
ICING
INGREDIENT
MILK
MOUSSE
PUDDING
SEMISWEET
SUGAR
SWISS
SYRUP
TREAT
TRUFFLES
UNSWEETENED
WHITE
Sample Output
CHOCOLATEORIGINATESFROMTHESEEDSOFTHETHEOBROAMACACAOTREE
Locations of the Words (Shown for Reference Only)
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments
What does RTE(✗✗✗✗✗) error mean?
RTE means Run Time Error, meaning that your code has an issue that forced it to stop. You can read more about it here: https://dmoj.ca/about/codes/.
The X's show how you did on each test case. You get an X for a wrong answer, and an O or a check mark for a correct one.