15/11/2013
Campus Challenge 2014, Question 3: Scrabble (Programming)
Scrabble is a word game in which two to four players score points by placing tiles, bearing a single letter, onto a gameboard which is divided into a 15×15 grid of squares. The tiles must form words which, in crossword fashion, flow left to right in rows or downwards in columns.
See the following image for an illustration of a scrabble game in progress:
https://drive.google.com/file/d/0ByV4jBpCvIshQnJiRGQtM25yLTQ/edit?usp=sharing
Each player is provided 7 tiles from a bag. A player may form a valid word by using an existing tile as a seed. The objective is to use as many letters as possible to form a valid English language word. The longer the word, the better.
Write a program that accepts the following as input:
Input Case Number, Letter to use, its position in x,y and list of tiles in the rack.
1,Q,(1,6),A,S,U,R,E,S,T
2,O,(8,8),B,C,K,A,G,E,L
3,L,(12,2),P,E,A,S,T,A,N
4,G,(12,13),I,N,W,S,H,A,T
Your program should print :
Input Case Number, Chosen Word
For example, your output should look like this:
1, SQUARE
2, BLOCKAGE
3, PLEASANT
4, WASHING
See the following image for an illustration of the test input.
https://drive.google.com/file/d/0ByV4jBpCvIshc2VZTmxXdWdWTG8/edit?usp=sharing
If there are more than one solutions, print any one. Use the dictionary at :
https://docs.google.com/file/d/0ByV4jBpCvIshbnFnb1pPeVhaWXM/edit