Solve Crossword Puzzle


Script to solve Crossword Puzzle


-------------------------------------------------------------------------------------------------------------------------------------------------
HOW THIS SCRIPT WORKS:
There are two files named british-english and american-english which contains all words in the dictionary without their meaning i.e just the word only , in /usr/share/dict.
The puzzle  provided is compared with the words in any of the above files. 
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

#!/bin/bash

#for solving crossword puzzle
# put '?' in place of missing letter
# if you want british spelling replace 'american-english' with 'british-english'

read -p "please enter the puzzle:"

word=$(echo $REPLY | sed 's/?/./g')
cat /usr/share/dict/american-english | grep --color=always "^$word$"


-------------------------------------------------------------------------------------------

Suppose you want solve  puzzle "_ros__ord" , you should enter as ?ros??ord ( put question mark instead of blank spaces ). The script in this case is named crossword .OK lets solve this puzzle together ..





Ohh!! It is crossword !!

Enjoy Linux !!

Dont know what to do with these codes?? click here

No comments:

Post a Comment