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.

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 

Suggestions for Further Explorations

.Add more puzzles (and rules!)
 
 
   
   

 

Original:  mmmm dd, yyyy

Modified:  October 04, 2016

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