Fill The Blanks Puzzle

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]

 

Search

Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.

 

Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.

 

Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only

 

 

Problem Description

Many of the 10 given three-letter partial words have more than one choice of final letter to form a common four-letter English word. Use all of the supplied letters exactly once to fill the blanks and complete all these words.
There is only one solution.

Partial words AHE_  BEE_ CHU_ DOR_ GAV_ KIT_ MIN_ REA_ SIG_ TEA_
Final letters D E F G H K L M N X

Background & Techniques

Source: 2014 Mensa Puzzle-A-Day Calendar for June 12, 2014.   Finding the solution is a matter of uniquely matching each of the three-letter partial words with one of the the given 4th letters.  For example TEA_ could form TEAL, TEAK or TEAM.   using the L, K, or M given letters. 

To solve the puzzle, users select each partial word and and then click the letter to complete the word.  The program uses the included dictionary to verify that the 4 letters form a valid word before accepting it.  Clicking a completed word will remove the 4th letter and make it available for use elsewhere when mistakes are discovered.

Non-programmers are welcome to read on, but may want to jump to bottom of this page to download the executable program now.

Programmer's Notes:

A TStringList, Words, contains the 10 partial words.  The "OnClick" exit uses the DFF LineNumberClicked function to save the line index in variable SelectedWord.  If the 4th character is underscore ("_"), we just append '<==' to the word to provide a visual indication of the current selection.  If the 4th character is not "_", the letter has already be placed there and the user is requesting that it be removed.  In this case, we replace the  4th letter with "_", append the "<==" selected indicator to the word, and replace the removed letter into the its original position in the Lettergrid TStringGrid.

Lettergrid contains the 10 available letters in a 1 x 10 TStringGrid.  An "OnClick" event exit, checks that there is a letter in the row clicked and there is a valid Selectedword value pointing to the Words TStringList. The Lookup function in our UDict library unit validates the word.   If valid, the letter is placed in position 4 of the SelecetedWord entry, and we replace that letter in LetterGrid with a space character.    

Our UDict library unit and the Full.dic dictionary file are used to verify that words formed by users are valid.. The DOR_ partial word required an addition to the dictionary which is included with each zip file but I also included a program check for this word so probably no need to replace your current Full.dic dictionary for this minor change.

Exploring the Program 

Suggestions for Further Explorations

Allow other versions of this puzzle type to be defined, saved, & reloaded.
.
 
 
   
   

 

Original:  mmmm dd, yyyy

Modified:  February 18, 2016

 
  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright 2000-2017, Gary Darby    All rights reserved.