Home  |  Introduction  |  Newsletters  |  Programs  |  Feedback

 

Search:

WWW

DelphiForFun.org

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 CD.zip 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?

 

Google
 

 

    

Search WWW

Search DelphiForFun.org

 

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

 

July  8, 2012

Delphi For Fun Newsletter #64

I'm not sure when the "dog days" of summer occur, but I would not want days any doggier than the past 10!  The heat is supposed to break tomorrow, thankfully.  For the 1st time in the 20 years we've been here, I'm shopping  for an AC unit for the house.  It is 90 outside right now and 82 in the house.  In Roanoke that would be cool, but here on the mountain we've been spoiled and consider it to be hot!  At least it is the season for some good "minor" sports on TV and the heat provides a good excuse to stay in and enjoy tennis, golf, auto racing, and cycling with the Olympics coming up soon.  All of these guys and gals exhibit what it takes to win: native ability, knowledge of techniques, and motivation to work, work, work.   Sounds similar to what it takes to be a good, if not great, programmer and problem solver!               

This quarter has a couple new items: a Sudoku solver and generator, a Daylight Saving start and end date calculator, and a Blue Moon schedule calculator were all fun.  And, of course, the usual batch of enhancements and fixes for existing programs.  Here are the  postings for the past three months.    

---------------------------------------------------------------------------------

April 7, 2012:

"Hints", in blue, are a display option

 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).   
 
 

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 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 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 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 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. 

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).   

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 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 19, 2012: A Sudoku Helper program was posted last month which led to this week's project, generating random Sudoku puzzles.  As usual, the problem turned out to be harder that I thought.  Generating valid filled boards is relative easy, there are billions of them.  The hard part is to remove some of the values and meeting the requirement that the board can be filled in only one way.  Once 53 or so numbers have been randomly removed (28 clues), more than 99.8% of the resulting boards will have two or more solutions and the probability of a random unique solution decreases rapidly from there.   It's still a work  in progress, but Sudoku V3.0 posted today averages about 1 unique solution per 400 boards tested  for random puzzles with 28 or more clues. 

June 4, 2012:  One more enhancement to help a used debug a customized keyboard problem:  Key  Codes Version 3.0  displays scan codes when  KeyDown as well as  KeyPressed and KeyUp events occur.   This version also lets the user verify that left and right keys for Shift, Ctrl, and Alt  are identified correctly.

June 6: 2012:  Program CutList . assists in creating efficient layouts of rectangular parts for woodworking or other projects.  It is  the most  popular program on DFF but its complexity has made it more than a "for fun"  project so current development is restricted to bug fixes.    A couple of minor printing problems were corrected today - so minor that I'm not updating the version number. But printed diagrams now have a slightly wider part outlines to improve visibility. And the extra blank page preceding printed diagrams under some conditions has been eliminated.

June 11, 2012:  Last month's posting of Clear Blank Lines triggered a number of enhancement requests from users.  Clear Blank Lines Version 3.1 posted today adds these features:

  • Trailing as well as leading blanks can now be removed from non-blank lines
  • Leading  "Tab" characters, previously  treated a spaces and deleted with the "leading blanks" option, may now be optionally  retained or deleted when leading or trailing blanks are removed.
  • A "character select" option allows lines with a specified character to be removed or to be the only lines retained in the output.  This was requested by a user needing to extract email addresses from text files.  Retaining lines with "@" characters will ease the process.
  • A new "case" option allows  text to be converted to upper or lower case. 

June 21, 2012:  A small bug in our UBigIntegersV3 unit resulted in consolidating all of the library file updates from the past 3 years into a new library release, DFFLIBV14.  Also, the RSA encryption demo program, which requires some math with very large random integers, previously used a tailored version of the BigInteger class. Those routines have now been included in UBigIntegersV3 in the new library release.  

It's been a while since I've written a "just for fun" program, but I recently learned the definition of a "Blue Moon" so I'm next going to try generating a "Blue Moon Schedule" for any give date range.  

July 6, 2012: 

Back to work after a break for the holiday.  Blue Moons, a program which calculates occurrences full moons which are called "blue" even though they are not.   There is speculation that the Middle English word for "blue" which also meant "betrayer", used that meaning because the occurrence of 13 lunar months in some years messed up their use for agricultural and religious purposes.  In any event, the phrase "Once in a blue moon" in English indicates an event or condition that rarely occurs.  There are  two common definitions and the program provides results for both.      

 

 


  • "I've missed more than 9000 shots in my career. I've lost almost 300 games. 26 times, I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed."  - Michael Jordan, Basketball

  • "Winning is a habit.  Unfortunately, so is losing" - Vince Lombardi, Football

  • "I know I can beat him on any surface." -- Roger Federer,  Tennis, after losing to Rafael Nadal in the French Open semifinals.

  • "I've had confidence in myself all along. It was just a matter of getting the pieces back in place." - Dale Earnhardt, NASCAR race car diver

  • " I can't remember a day when I didn't train."  Michael Phelps, Olympic Swimmer 

  • "It's too damn hot in here!"  Violet Darby, Wife


To subscribe or unsubscribe from this newsletter, visit http://delphiforfun.org/newsletter.htm

309,000  visitors and 338,000 program downloads in the past 12 months!

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