DelphiForFun Home

Home  |  Introduction  |  Newsletters  |  Programs  |  Feedback


Search WWW



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

August 23, 2015: Most of this month has been spent on outdoor activities.  Due to generous rainfall and moderate temperatures this summer, trees and shrubs have tried to take over driveways, trails and yards.  With my trusty chainsaw and a new wood chipper, I have almost broken even in reclaiming the space that nature is trying to confiscate.   Of course, she will always win in the long run. 

Which reminds me, my book-of the-month is  The Canon by Natalie Angier.   It really is "A Whirligig Tour of the Beautiful Basics of Science".. She is something of a wordsmith, but the knowledge conveyed here reminds us of what an infinitesimal part of the universe we represent.  For example, our rather small sun is one of billions but still converts 700 million tons of hydrogen to helium every second, has done so for 5 billion years, and will do so for 5 billion more before it runs short of fuel and  starts its expansion to a giant red star!    Highly recommended.

Of course, I have also kept up this month with the daily Mensa Calendar puzzles.  Here's an interesting one from August 18, which can be solved with the aid of our Brute Force algebraic equation solver.

Nine Knights numbered 1 through 9 are seated at the Round Table in such a way that every knight's number is at least 3 higher or lower than its adjacent neighbor. Also, the two knights at the end of the horizontal line sum to an even number. With knights 2, 6, and 8 seated as shown, seat the rest of the knights,

The unique solution can be found by assigning variables to the missing positions and defining equations using Absolute Value (abs) and Modulo (mod) functions.  The puzzle file is now included in the Brute Force downloads as Mensa-08-18-15.prb


July 28, 2015: A fellow Delphian recently asked if it was possible to highlight a particular word wherever it occurred  in a DBGrid. I gave him some suggestions but didn't hear, back so I decided to try it for myself.  I used a StringGrid to create a demo in our Delphi Techniques section which should transfer to DBGrids.  As usual (and thankfully), there were a few unexpected complications  to sharpen problem solving skills and keep programming fun.  Check out the GridWordHighlight page for more information and downloading the code. 

July 17, 2015: A couple of years ago I posted a bulk Find and Replace program which would scan text files in a given folder which match  given file name mask and change all occurrences of a given string to a new replacement string.    I recently needed to process a set of files of email addresses and replace all "@" characters with commas (",") so that Excel could automatically break out the website address parts into a separate column.  The files happened to be in Unicode character format (2 bytes per character) which my program didn't handle correctly.  Find and Replace Version 2  posted today corrects that.  Both ANSI and Unicode character files can now be processed correctly.      

July 8, 2015:

Chess PGN (Portable Game Notation) is a widely used format for recording chess games for historical or study purposes.  There are many playback programs available and the world didn't need another.  However a DFF viewer requested it about 10 years ago and I couldn't locate an existing one in Delphi, and it sounded like  (and was) an interesting project.  Chess PGN Version 5,2 posted today has a small change which doesn't change the executable results but prevents aborted execution after recompiling with data range checking.


June 29, 2015:  Acrostic Variation, posted today, implements a solver for this Mensa calendar puzzle from March 16, 2015.  It uses a search technique probably used by most human solvers; concentrating on the word intersections to find candidates; the program just does it a lot fasterJ.  

June 17, 2015:  A License Key Generator program was posted several months ago to explore how unique  keys might be generated to allow a program to verify owner or expiration date information.   To my surprise, the program was recently flagged as a "Keygen Trojan" by a well respected security scanner.  I revisited the source code and made a few formatting and spelling enhancements and the warning disappeared.  So, just in case, I reposted the License Key Generator V1.1 program today.    


Black clouds - not so good

Better now

June 10, 2015:  A program illustrating many graphic manipulation effects in Delphi was posted 12 years ago.  It was largely written by a young Czech programmer, Ivan Sivak, who I'm sure has moved on to bigger and better things by now.  I made only minor changes to his code before posting it.  A fix was posted today in the Contrast/Brightness section of Graphic Effects correcting a problem of white or light gray pixels displaying as black..

May 31, 2015:  Just time to squeeze in one more little program this month.  Outdoor activities have taken up most of my time recently and most of the daily Mensa Calendar puzzles are either solvable by programs I've already written or are not amenable to being solved by computer.  But yesterday's offering  was a good candidate so here it is:

 A surprising number of U.S. state names contain multiple pairs of letters which form standard two-letter state abbreviations. For example ALABAMA contains two: AL and MA (Alabama and Massachusetts).  If we don't allow overlapping abbreviations, there is only one state name that contains as many as  four abbreviations.  Can you find it?

 Search State Abbreviations is a  50 line program which finds the answer by listing and counting the embedded abbreviations for all 50 states.  The preceding link is to a page of twenty or so Beginner's level programs.  Just click the bookmark or scroll to the bottom of that page to download the source or executable for the new  program.    

May 11, 2015:  A viewer discovered a memory leak in our Big Integers unit which carried over to the Big Float unit.  UBigIntsV4 allows mathematical operations on integers whose size is only limited by available memory and UBigFloatV4 extends the extended precision feature to floating point numbers using UBigIntsForFloatV4 for the integer parts.   The Free method in both of the big integers unit released the memory specifically allocated by the program but neglected to call the inherited Free method which releases the memory taken by the system when the integer object was created.    Today's' postings include a revised library zip file, DFFLibV4_11May2015 containing the revised units.  Two test programs, BigIntsTest and BigFloatTest were modified to report allocated memory after each operation to verify the correction and to help indentify future memory release problems.

Yes J!

No L


 April 29, 2015:  Three points are placed randomly on the circumference of a circle. What is the probability that all three points lie within same semicircle?   Check out Circular Reasoning to verify your answer.





April 19, 2015:

A buddy of mine is designing a Veteran's Day monument which will consist of panels representing the Armed Forces services and aligned in such a way that the sun will cast a shadow on the memorial plaque on November 11 at 11:AM.  At his location, he thought that the sun would cast the shadow again in February when the the sun will be at the same altitude at that hour.  I took advantage of the opportunity to educate him about the  "analemma" figure 8 shape of the sun's path through the sky and assure him that the February sun at 11 AM will be about 10 degrees further East than the November path.  I updated  AstroDemo Version 2.0, our Astronomy unit test program, with an "animated" analemma. That option  helped me determine that at 11:11 AM in Lucedale, MS, the crossing point of the figure 8 occurs on February 12 as days are getting longer and August 29 on the way back down, so no problem for Jim's project!  


April 13, 2015:  Here's an interesting little puzzle that requires some human thought to solve efficiently: 

A farmer tells his son to select five watermelons to take to market. Because the watermelons are sold by weight, they must be put on a scale before the trip to town, but the son makes a small mistake and weighs them in pairs. Here are the weights he comes up with, in pounds: 20, 22, ,23, 24, 25, 26, 27, 28, 30, 31.  How much does each of the watermelons weigh?  (Source: Sit & Solve® Brainteasers (Sit & Solve® Series) 

The Weighing Watermelons program posted today implements the solving strategy.


March 15, 2015: 

Another calendar puzzle that is well suited to using the computer as a helper.

The two pieces required to solve Mind Your Ps and Qs will not only be mirror imaged (flipped about their vertical axes), but also reversed to top bottom (flipped about their horizontal axes).  Interestingly, and perhaps a clue to help solving these puzzles, these two flips are equivalent to a 180 rotation.

Rather drawing heavy outlines, the two pieces are defined on the program by assigning a color to each of the two letters and assigning colors to other grid cells by clicking.  

March 8, 2015:  Windows makes it's time zone information available to programs in a "TimeZoneInformation" record.  Several years ago I wrote a program to illustrate how to access this information in Delphi,  the namesake programming language for this site.  TimeZoneDemo Version 2 corrects the Daylight Saving time start and end date displays from that record which requires an undocumented  "trick" to display correctly.  The system "Day of Month" value in these fields does not contain day of month but rather acts as a template defining which occurrence of the "Day of Week" value defines Daylight Savings starts and ends (1st Sunday, 3rd Wednesday, etc).  The supplied values are now converted to the correct "Day of Month" in the program display.

March 3, 2015:

This puzzle type requires the player to find the word for the missing row of a 3-row grid such that every column is a valid 3-letter word.   WordGrid_3LetterWords Version  2.0 posted today reflects changes required to solve the 7 column Mensa Calendar puzzle for February 13, 2015 (shown at right).  As usual when I revisit a program, a  couple of additional  enhancements are  included.

The What's New Archives

(Click to expand)

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