Words Differing by 1 Letter

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




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.

Mensa Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa 365 Puzzlers  Calendar 2017

Mensa 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)


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

Search DelphiForFun.org only




Problem Description

This program implements a word search for word which differ from a given word by a single letter.

Background & Techniques

Here is is the Mensa Calendar puzzle which prompted today's program. My language-oriented, crossword-addicted, wife solved it in less than 10 minutes. I got two of the three words in the line 2 puzzle in 10 minutes; then decided it was programming time!

The program will load our "Full" dictionary when the program  starts, then, when a word is entered and the Search button clicked, all dictionary words which differ from the input word by one letter will be displayed. One must still find the three synonym words from each line, but I could handle that.

The program and the dictionary are included in the executable zip file download available below.

Programmer's Notes:

This simple program required less than 30 lines of programmer written lines of code to implement the solution..  A KeyPress event exit makes sure that the user entered word is in capital letters.  The Search button sequentially retrieves all of the dictionary words of the same length as the input word.  Each word retrieved is converted to all capitals, compared letter by letter with the input word and differences are counted.  If the difference count = 1 after all letters have been compared, the word is added to the display list in Memo2

Running/Exploring the Program 

bulletDownload  executable
bulletDownload source  (Note: the UDict dictionary unit and the Full.dict dictionary reside in our library zip file of commonly used units.  Library file DFFVLIB13 or later will be required to recompile this program )
bulletDownload current library file (DFFLibV15) .


Suggestions for Further Explorations



Original:  March 12, 2014

Modified:  May 15, 2018

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