DelphiForFun Home

Home  |  Introduction  |  Newsletters  |  Programs  |  Feedback





Support DFF

 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.

If you shop at Amazon anyway,  consider using this link. 


We receive a few cents from each purchase.  Thanks



The index page for all Programs on the site?

The DFF Play CD?

Zipped file DFF Play contains  executable version of about  75 of the 200+ programs from the site, mostly those I particularly liked or thought would be of widest interest for non-programmers.  The file is rather large, about 20mb..

Anything else?





Search WWW



Not a programmer (yet)?

 That's OK -  the executable version for any puzzle or  game you find here is available for download.  Just scroll down to the bottom of most any description page and you'll find a "Download executable" link. Downloaded programs are in "zipped" format to reduce size and may require an "unzipper" program unless you are running Win XP or later.  Here's a link to a free one. 

Check  out  the Most Popular  Downloads from DFF   (updated weekly)

First time visitor?

Take a look at the Introduction page to see what this site is about

Notes for Teachers


What's New

December 13, 2017: 

The Cast A Word puzzle has been solved!  Just not by me.  Recall that we are given 16 four letter words which can be formed by throwing four dice with letters on their faces and reading the tops.  The problem is to assign  letters to the dice in such a way that this can be done.  Cast  A Word. Version 2 written by Sergio, a smart, older, Italian, "just for fun" programmer bailed me out.  Click the link to find out more and download the program.

November 29, 2017:   Log Sawing Version 4 was posted today.  This program suggests effective ways to saw logs into lumber with a horizontal bandsaw.  It is a major rewrite from the original, hopefully for the better.   The original program was written in 2010 when owning a sawmill was only a "big boy's" dream.  Now that the dream has come true, it's time to make the program more than a math & programming exercise.  The biggest change from version 1  is the more realistic reporting of cutting positions as inches above the bed since the saw head moves down rather the the log moving up as boards are cut..   Click the link above to see more change details and to download the program.    

October 31, 2017:  A grandson's wedding, a run-in with an uninsured deer, replacing a garbage disposal when it its retaining clamp rusted through, breaking-in the new sawmill, and a hard-to-crack puzzle have made this a busy month without much to show for it.    The puzzle of the month Cast A Word,  is an interesting one that that's going to require more time to program.   In desperation, I did solve it with pen and paper today, so might get a solver programmed before Thanksgiving J .  


September 22, 2017: 

Another challenging puzzle from the Mensa Calendar requires you to fill a 5x5 grid with the four letters A,B,C,D when you are given the number of occurrences of each letter in each row and column like this. No adjacent duplicates allowed in any row or column.   

This September 7th puzzle has been added to Mind Your ABCDs, Version2,0.  For user play, letter counts will be updated as letters are entered.  And,  there is a "Solve it for me"  after you give up J.  Check it out!




September 5, 2017:

Here's a puzzle for which I coded a solver several years ago. This one is from a recent page of my  Mensa Page-A-Day Puzzle Calendar.   Stars must be placed on  pre-defined subdivisions of a grid with no duplicate stars in any row, column or adjacent diagonal cell.  Stars On A Grid Version 2 allows users or the program to solve this puzzle  included in the  downloaded samples.  New puzzles can be saved and reloaded.  Some typos and design improvements are included in this version..


August 30, 2017: Just time to squeeze in one more program this month.  This one is puzzle #57 from Terry Stickles' excellent book Challenging Math Problems "How many numbers less than 1,000,000 have digits that sum to 3?  Examples: 1200, 111000, 21, and 300."  Program DigitsSumToThree started out as a Beginner's level demo of how to extract digits from a number, add them up, and count those that sum to 3.   This method works and is easy for the computer, but virtually impossible for a human to duplicate.  That led to an Intermediate level version with two additional ways to answer the question, even by us mere humans.  The link above provides more detail and the links to executable and source code for he program.

August 19, 2017: It's been a good news-bad news month.  The transfer of DFF from host EasyCgi to Alentus went fairly smoothly with FrontPage support restored, but I'm being swamped by spam emails (~ 50 per day) since Alentus apparently does no screening at the server levelL.  Outlook junk screening here at home is by sender address or domain name of which there seems to be an infinite number.  I  may be forced to another mail server if it cannot be fixed. Also thumbs down to EasyCgi for dropping FrontPage support without prior notice and for refusing to credit me for the unused 6 months of prepaid hosting feesL.

On the fun side of the street though, I did manage to crack a fairly complicated word search puzzle solverJ.  The puzzle solution requires forming five 5-letter words by selecting one letter from each row corresponding to the letter position in the word being formed. All letters will be used exactly once.  So the 1st letters of the words will be A, B, G, T, and W.  2nd letters will be chosen from U, A, R, L ,P with each letter appearing in one word, etc.   Word Search By Column has more details and download links for the program. 

August 1, 2017:  If you're reading this, I'm happy to report that the DFF site has been successfully transferred to the new host.  Feedback and Newsletter Subscription emails are working again and FrontPage can again be used to maintain and publish site changes.  Time will tell if if there are drawbacks as yet undiscovered.  If you encounter problems, please use the feedback to let me know., 

July 25, 2017:  Starting the site relocation tomorrow.  In theory, nothing will change from the visitors viewpoint until  I verify that all is working on the new site. 

One more program update posted today was to fix a scaling bug in our program which solves problems like this one from my Mensa calendar entry for July 23:.


The challenge is to find a word for the middle row which forms a  three letter word in each of the seven columns.  Program WordGrid_3Letters, Version 2.1 does that in short order.


July 16, 2017:  We're closing in on the web site move to regain control of Feedback and Newsletter subscription emailing (currently unavailable).   Should happen in  a week.

For today, another Mensa calendar puzzle lead to another small update to BruteForce V5.3.1. It eliminates a "divide by zero" error that occurred when solving this problem:.

I have some coins in my pocket and their average value is 15 cents. If I were to find a dime and put it in my pocket, the average value of the coins in my pocket would be 14 cents. What coins do I have in my pocket? Source> Mensa Puzzle Calendar entry for July 16, 2017;

June 12. 2017: Brute Force is my "go-to" puzzle solver for an amazing number of puzzle types (50 sample puzzles included in the downloads).  It solves by exhaustive search ("trial and error") if they can be described with a set of integer equations with a limited range of solution values.  I recently checked to see if it could solve the "Matchstick" puzzle for which I posted a user-play version a couple of years ago.  It turns that it could, even though I had to add two additional operators to describe partially burned matchsticks.  Brute Force Version 3.5 has the details and download links.

June 8, 2017: FrontPage, the website builder used here at DFF is on life-support and options for recovery seem to be limited.  Long time viewers have heard this song before; the basic problem is that there is no easy way to convert to any other product.  Best advice seems to be "save the text and convert each page manually"; a job that sounds like weeks or months  of "not-so-fun" time to get back to what I have now.     Currently, the only way to update the site use to edit a local copy and upload the revisions via the FTP transfer protocol which has introduced a whole new set of problems for a newbie like me.    

In any event, these are my problems, not yours - just be patient while I learn and search for solutions.  I do have a couple of changes to post - the first is an expansion of our Latitude-Longitude Distance unit and the test program for it,  If you're interested in that sort of thing, here's the link to the  LatLonDistanceTest page with more information.

May 23 2017:   I recently needed to extract information about a particular location collected over time and buried in many large files.  This was a one-time study, not worth writing a separate program.   In order to assemble the needed data  from several files, I modified our Text Search program to append selected records into an single text file  Text Search 2.2 posted today, now allows appending as  an alternative to overwriting an existing file with the same name. 

May 14, 2017:  Here's a  puzzle that required a 25 line program to solve (at least for me). If you want to try it on you own, here it is:

We have two normal 12 hour clocks that start running at 12:00.   One loses two minutes every hour and the other gains two minutes every hour. How many hours will elapse  before both clocks again show the same time?

Program FastSlowClocks simulates the two clocks by incrementing the times by 62 minutes (Clock 1) or 58 minutes (Clock 2) for each real hour interval. Starting at time 12:00  (00:00 really), clock times are displayed for every "real" hour until they again match.  The link above points to a Beginners page with 2 dozen simple programs described for beginning Delphi programmers, so scroll to the bottom of the page to see the entry for this one.  Viewing  the program results showed that I should have been able to reason my way to the solution, (but I didn'tL).  If you just want to download the executable file to check your answer, clicking this link is a simpler way. 


April 21, 2017: Here's a Delphi demo, HeapsPermute, of an algorithm developed by J.R. Heap in 1963 which generates permutations of arbitrary data items. It is quite efficient because it swaps only 2 elements for each permutation generated. The disadvantage may be that that there is no apparent order in the generated permutations.  Search "Heap's algorithm" on Wikipedia for more information.  I plan to use the algorithm in a future "Made from scratch" puzzle solver which doesn't use the existing DFF Library. 

March 28, 2017:  We're back!.  If you received a "Service Unavailable" message in the past two days, no worries.  The host site maintenance  guys mess up and cause this about once a month.  It's usually only a couple of hours, but this time it was 2 daysL.  I'm guessing that the root cause is that the DFF site runs under FrontPage, a terrific website builder abandoned by Microsoft years ago with no suitable conversion aids or equivalent replacement available.  Manual conversion to something less usable is an easy task to defer, so I'm limping along with the old, unsupported builder program and not many choices for finding another host.    After careful cost/benefit analysis, my conclusion is that what happens in the future is a problem to be  addressed in the future.  

In the meantime, I discovered a small bug in an old beginner's level program which generates odd order "magic squares" up to 51x51 using an ancient algorithm.  Magic Squares V1.1 corrects a grid sizing problem for the 3x3 square.  

March 19, 2017: CutList Version 4.05 posted today  corrects a few misspelling and truncated text errors  caught by a couple of sharp eyed users.  Thanks to Karson and Anthony for taking the time to let ne know.


March 6, 2017:  Several years ago, a buddy of mine took on the  design and implementation of a children's water fountain with multiple nozzles squirting at random intervals and durations.  I created an animated simulation to illustrate what it might look like.  The result was posted here in the "Delphi Techniques" section as an example of how to draw on a graphic control. (a "TNozzle" in thus case).  You can view a picture of the resulting real "Splash Pad"  here.

 A Delphi programmer recently sent me his attempt to move the TNozzle  class to a separate unit and found that the his drawing attempts were displayed in the wrong place.   The solution was to draw on the  canvas of the TNozzle Parent property.   ShapePaint Version 2.0  demonstrates how to do this. 


The What's New Archives





  • July 7, 2014:  Note: this "Collapsible"  month by month list of postings since year 2000 is not collapsing for some reason, making this a very large home page.  Until it gets fixed, you can reference the complete quarter by quarter list of postings on the Newsletter page.