Teleword is a word puzzle designed by David Ouellet and widely featured in newspapers, including Pakistan's Dawn. This project is a C++ solution for finding and solving any Teleword puzzle provided as a text file.
The puzzle consists of:
- A 15x15 grid of letters
- A list of hidden words
Objective: Locate each word in the list within the grid. Words may appear forwards or backwards across rows, columns, or diagonals. After identifying all words, the leftover letters, read row by row, spell out the Teleword solution.
The program reads from a file named teleword.txt
with the following format:
- First 15 lines: The 15x15 grid, with letters separated by commas.
- A blank line.
- List of words, separated by commas.
Example Format: R F D H R T N A T N U O C C A
E E E L S L E A D I N G Y D C
T H N I L A R O T C A R V E T
N C T N A I C I T U A E B S R
I R I W A T K R O T R M T I E
A E S A O L A S E T O B E G S
P V T R P I P R I D C A A N S
R I F D N L C S E D A N C E R
E R L I K E E L S P R K H R E
P D N O S R D H E E O E E N M
A G U O T H A I T A R R R R R
R U R F T R I N T A N T T A A
I A S I I A U N S O L E I E F
N R E N T H R A G R R K R A R
G D G D P L A Y S R E T I R W
- Grid and Word List Display: Visualizes the initial grid and list of words.
- Word Highlighting: Highlights each word in sequence upon user input.
- Grid Visualization and Teleword Solution:
- Displays the grid with only the located words.
- Shows leftover letters forming the Teleword.
- Displays the final Teleword.
- Statistics:
- Time taken to locate each word and overall.
- Word length and average word length.
- Distribution of word directions (horizontal, vertical, diagonal) with counts for forwards and backwards orientation.
- Teleword Scatter: Number of rows containing Teleword letters.
- Heaviest Row and Column: Rows and columns most affected by words.
-
Compile the Program:
g++ teleword_solver.cpp
-
Run the Program:
[ ./a.exe ] or [./a.out] teleword.cpp
Note: Replace
teleword
with your input file name (excluding the.txt
extension) We have used command line arguments in this code to simulate the scripting process. -
Follow Prompts to locate and highlight each word, view the Teleword, and see the puzzle statistics.
Displays the solved grid and Teleword solution, followed by the statistics (word times, lengths, total and average times, direction distribution, Teleword scatter, heaviest row/column).
- C++ Compiler (e.g., g++)
- Libraries: Ensure all additional libraries specified in
teleword_solver.cpp
are available.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit changes (
git commit -m 'Add AmazingFeature'
). - Push to branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
Distributed under the MIT License. See LICENSE
for more information.
Abdul Ahad
LinkedIn: linkedin.com/in/abdul-ahad-988305286
Email: ahad06074@gmail.com
Project Link: Teleword Solver GitHub