Word Attribute Puzzle Solver

[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

This program uses predefined rules to apply predefined "letter sets" to a given set of phrases with unknown common characteristics looking for a rule that applies to all of them and to a single phrase in a second list of solution candidates.  

Background & Techniques

Here's a sample of what I call "Word Attribute" puzzles.  I've have not had much success in solving this type , but usually think that I should have.   This program provides two sample rules and two sets of letters which between them can lead to a solution.  More significantly, it provides a template for solving future puzzles of this type. 

 

Programmer's Notes:

There is nothing particularly complex about the code for this one.  

The Search button initially  performs embedded loops through

  1. the selected rules containing a loop through.
  2. the letter sets, containing a loop through
  3. the common attribute (left column) phrase list.

 Rules display in a CheckListBox so they can be included or excluded from each  search.   If all of results the given "left column" phrases,  match for a particular rule and letter set, the candidate phrases are tested and any passing are reported as solution.  Of course, in a well constructed puzzle, there will be only one phrase that passes. 

Function ApplyRule is passed the rule number, the letter set and the phrase to be tested.  It returns a TResultRec record which identifies the type of solution found (Boolean, String, or Integer) and the corresponding true/false, string, or integer array values.  The current puzzle uses only the Boolean and Integer types.  TResultRec does not definitively return pass/fail for the data it contains, only the value for the type of rule tested.  The loop code which calls ApplyRule must determine the validity of the rule base on results for other phrases in the set being tested.  ApplyRule calls a different unique function for each rule type.  The two rule evaluation functions included in this initial release are  PassesRule1 and PassesRule2.  

Running/Exploring the Program 

bulletDownload  executable
bulletDownload source 

Suggestions for Further Explorations

.Add more puzzles (and rules!)
 
 
   
   

 

Original:  mmmm dd, yyyy

Modified:  May 15, 2018

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