Adage Anagrams

[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.

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.)

Contact

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

Search DelphiForFun.org only

 

 

 

Problem Description

Given an anagrammed version of a common adage, unscramble it to its original form.

Background & Techniques

Here is the January 23, 2013 puzzle in our "Brain Game" page-a-day calendar for this year.

"NAIL BITING REFRESHES THE FEET" is an anagram for what common adage?

What would have been very difficult without computer help was doable once an Internet search provided a list of sample proverbs.  It took about 10 minutes of scanning the list by eye looking for items with two occurrences of the letter "F" and with no  "O"  to find the solution.

It took about another 30 minutes and 75 lines of written code to implement a comprehensive version  of this strategy  using a downloaded text file of common adages ("Adage.txt" file is included in the downloads).  Now I only hope that there are many similar puzzles this year!   

By the way, see this link for the difference between an "adage" and a "saying", "maxim", "saw", "motto", "epigram", "aphorism", or "proverb".  

Programmer's Notes:

Adages were copied and pasted loaded into a text file "Adgae.txt" from 2 sites returned by Googling "Common adages".  Our ClearBlankLines program was used to remove blank lines and leading blanks from the file. 

In the program, a LoadAdages button loads  Adage.txt into a new TStringlist, AdageList.  The list  is sorted so that duplicates from the multiple sources can be eliminated.   A TStatsObj object is defined with two fields: a Totalcount integer to be filled with the number letters in an adage and LetterCounts,  a 26 integer array,   indexed by characters "A' through 'Z'.   Procedure Fingerprint fills TotalCount and LetterCounts from a passed string parameter.  One of these "fingerprint" objects is created for each adage inAdagelist and saved in the Objects property.

A TEdit control, Edit1, is prefilled with the Nail  Biting adage, but others could be keyed or pasted in for future problems.  The CheckIt button creates the fingerprint for the anagram and then passes   against the fingerprints stored as objects in Adagelist.  If an adage is found whose fingerprint matches the anagram, a solution is reported.

Addendum: April 1, 2013 - The file "Adages.txt" was omitted from the original posting; it now included in either of the downloads.

Running/Exploring the Program 

bulletDownload  executable
bulletDownload source 

Suggestions for Further Explorations

It would be feasible to develop a "closeness of match" parameter to handle cases where no exact match is found perhaps because single word is different.  Reporting the closest matches might enable a human to complete the solution.  
   
   

 

Original:  January 24, 2013

Modified:  May 15, 2018

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