Amazon.com Widgets

DelphiForFun Home

Home  |  Introduction  |  Newsletters  |  Programs  |  Feedback

 

 

Want to help 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.

In Association with Amazon.com

   

Want the index page for all Programs on the site?

Anything else?

Search

Search DelphiForFun.org only.

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

May 11, 2012:  ClearBlankLines is a program which removes entirely blank lines from text files.  It was written several years ago to solve a particular problem I had with generated html code on my website when some unknown action added 35,000 blank lines to web pages.   The pages were still viewable but speed slowed considerably, required storage space increased,  and my HTML editor program choked.  I have had a surprising number of emails thanking me for the program since then for  helping them resolve similar problems.  Today's update adds an option requested recently by a user to also remove leading blanks from lines which contain text.           

May 8, 2012:  The CHOICE statement type was added to Logic Problem Saver Version 4.1 today after 5 days of challenging work.  The full program is one of the most complex I've written, with about 6000 lines of code equally divided between handling the user interface and searching for a solution.  It uses facts, and other logical relationships extracted from problem description text by the user.  Choice statements simplify the user's job when we are told that a variable value is associated with 2 or 3 possible values of another variable.  Such statements allows us to generate (negative) Facts about what values the associated variable cannot have.  For example: If we know that "Bob lives either in Virginia or North Carolina" (the Choice statement), then he cannot live in any of the other states that the problem allows.  Those negative facts (e.g. "Bob does not live in Florida") can help complete the "Truth tables" necessary to resolve who lives where.   In the May 3rd Geocaching problem, the three Choice statements eliminate user entry of 24 of those negative Fact statements.  Now if I can just find a dozen or so similar problems, I will have saved enough time to pay for effort of the enhancement. J     

May 3, 2012:  Another avid logic problem solver managed to break my "Logic Solver" program last week, this time with a Geocaching problem with 10 different teams, home towns, and cache counts.  The previous version  would only handle 9 values per variable without burping, but Logic Problem Solver, Version 4.0 , just posted,  handles up to 15 values and can solve the problem (also included in the download if you want to try your hand).   

April 28, 2012: "Points from 4 Sensors" is a program which calculates the location of a target in 3D space when it is given the locations of 4 sensors and the distance from each sensor to the target as they (or the target) calculates.  The program completes the picture by calculating the (x, y, z) coordinates of the target using a method called Gaussian Elimination to solve the 4 distance equations.   Point from 4 Sensors, Version 5.0 posted today adds an alternative technique, Trilateration, to find target coordinates.  Trilateration appears to be more robust, finding  solutions when the sensors are coplanar or nearly coplanar and  the Gaussian method fails. 

April 21, 2012:  Here's a program, DSTCalc,   investigating how Daylight Saving Time start and end dates can be calculated using simple equations without resorting to high level date-time routines.  This might be useful for programmable devices which need to know but don't have the advantages that the big boys have.  The program also contains a Delphi  GetNthSunday function using the high level routines to verify the simple equation approach. 

April 13, 2012:  Sudoku Version 2.0  was posted today.  It adds the "Trail and Error" solver discussed. earlier and cleans up a couple of other minor bugs.  We'll let it rest for a while now as I move on the the next project.

April 11, 2012:  Sudoku Version 1.3  corrects a problem with the Undo button trying, under some conditions, to Undo more moves than were made resulting in various undesirable outcomes.    

April 8:2012:  It didn't take long to find the first couple of program bugs in yesterday's posting:  Sudoku Helper/Solver V 1.2 was posted today to fix problems with missing default file extensions on saved puzzles and the missing final hint value when hints extended onto a second display line.     

April 7, 2012:  

Hints optionally displayed in blue

Here is the first (incomplete) version of a Sudoku Helper/Solver.  I wrote it  on our  Caribbean cruise last week while the rest of the family worked on solving the daily puzzles handed out by the cruise line.  My way is harder initially, but when they solve one, they have solved one; when I solve one, I have, in theory, solved them all!  (That excludes the possibility of  program bugs of course, but even those are new and non-repetitive problems to solve one-time.  I love it!) 

The program allows entering and saving puzzles.  As you run across those that cause problems, save and send them on as email attachments to feedback@delphiforfun.org.    Pace yourself and only send one per week please (in case the 6 included samples are the only ones the program can solve).   
  

March 21, 2012: A small update was posted today to clean up some documentation errors in the description screens of our RSA Keys Demo program.   RSA stands for the last names of the 3 guys that published an algorithm allowing secure message exchange.  In simplest terms,  RSA encryption works like this:

bullet

A wants to be able to receive secure messages from B

bullet

Alice has a key with public and private parts generated using some  well known mathematical magic using random numbers.  She publishes or sends the public part of the key to Bob.  (A and B are always Alice and Bob. J)

bullet

 B can encrypt his message using A's public key, using some more agreed upon (and public) math magic. 

bullet

B sends the encrypted message to A (and inadvertently to any eavesdroppers). 

bullet

Using a third bit of math magic which includes her private key, A decrypts B's message and accepts his offer to dinner. 

bullet

The eavesdroppers having A's public key, the encrypted message, and all of the math magic techniques still cannot find out when and where the dinner will take place because they do not know A's private key. 

Interesting stuff!

 

March 19, 2012:  I had some fun and learned some things this week writing a Squared Palindromes program which investigates finding  the smallest "even"  palindrome which is the square of another integer. 

March 12, 2012:

Typical solution using digits 1,1,2,2,2,2,2,3,3,3,3,3,3,4,5,5,5,5,6,6,6,6,6,7,9

A solver for a "Special" 5x5 Magic Square was posted today. I call it "Special" because we are given a specific  set of 25 integers from 1 to 9 (with repeats), which must be used to fill the square. The typical 5x5 Magic Square contains integers from 1 to 25 with rows, columns, and diaginals summing to 65.   Each row, column and diagonal in this case must sum to 20. 

A good exercise in Combinatorics and pruning search spaces!  The final version finds  about 5 solutions per second for the first 5000.
 

March 6, 2012: "If you draw a 9x9 by nine grid, thus giving yourself 81 small squares;  how many rectangles can you count in total? "   An  little 20 line program, Rectangle Counts, finds the answer and also leads to some interesting math.
 

February 27, 2012:  Fifty Probability Problems, Version 5  adds a fifth problem from the book, the hardest one yet, but a good chance to learn about using geometric progressions to solve a puzzle concerning chances for a poor shot to win a  3-way shootout. 

February 21, 2012:  I've spent much of the past couple of weeks travel planning for our next family cruise in March during the grandkids' spring break.  Zip lining in St. Kitts - whoopee!

 I spent most of my programming time on a dead end (so far) effort to create a program start or stop and restart a program based on a schedule or CPU or memory usage.  I need this to workaround a commercial weather system program which crashes periodically because it has a memory leak.

In the end, I decided to tackle another problem from the Fifty Probability Programs book I'm working my way through.  This one about a three way "duel"  is similar to one previously posted and, since I haven't cracked the analytical solution yet, Car Talk Shootout Version 2 now includes the experimental results for the new problem as well.         

February 7, 2012:  Here are two more probability problem solvers which I found more interesting than anything else I had to work on this week. Fifty Probability Problems,  Version 4 was added today:

    Problem 18: If 100 coins are tossed, what is the probability that exactly 50 heads will be showing?

    Problem 19: Samuel Pepys wrote Isaac Newton to ask which of these events is more likely: that a person get (a) at least 1 six when 6 dice are rolled. (b) at least 2 sixes when 12 dice are rolled, or (c) at least 3 sixes when 18 dice are rolled.  What is the answer?

 

The WHAT'S NEW Archives

(Click to expand)

 

 

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