April 12, 2014: Here's another problem solvable by by our Brute
Force program which applies exhaustive search matching possible values with
variables in a set of equations.
Brute Force Version 3.1 adds the absolute value function, "abs", to
equation formats to enable solving the "Billiard Balls" problem. The
problem is to arrange 10 billiard balls into a triangle meeting a set of rules
about the ball numbered 1 through 10. One of the constraints is that the
balls in a particular row all have numbers more than 1 away from their
neighbors. This constraint for balls with numbers "a" and "b"
can be expressed with the equation "abs(a-b)>1". Sample problem
BilliardBalls.prb is included with the download and is solved in about one
March 29, 2014:
A viewer was having trouble getting the program to work on his system,
receiving invalid data format errors. I could duplicate the error when
"Dual Channel" input was specified when only monaural input was available.
The problem persisted because the single/dual channel option was save and
restored across multiple runs. Oscilloscope
4.2.3 posted today is a temporary fix which resets the input format to
monaural when the program is started. I'll work on a better fix next
March 24, 2014:
March 12, 2014:
Here is yesterday's Mensa Calendar puzzle which prompted today's program. My
language-oriented, crossword-addicted, wife solved it in less than 10 minutes. I
got two of the three words in the line 2 puzzle in 10 minutes; then decided it
was programming time!
Just in case, the program and the dictionary are both included in the
executable zip file download.
March 6, 2014: Our Oil Tank
Capacity Chart program displays a chart of remaining gallons for various
liquid depths for a number of standard fuel oil tanks. I recently added
Version 2.1 to include a couple of new sizes at a user's request. Version
2.2. posted today, ,allows users to edit, add, or delete definitions and to
print generated charts. Fractional inch dimensions are now allowed so my
tank chart now matches the nominal capacity within a gallon for all depths!
February 28, 2014: A viewer working on a playback program for Chess games was having trouble building the keys for each rank using FEN notation. FEN uses letters for the chess pieces (P for Pawn, B for Bishops, etc.) and numbers to represent the count of consecutive empty cells. He didn't tell me that objective though until I had written this little demo program, Count Grid Cells which builds keys based on randomly placed letters on an 8x8 grid. The link is to a page of beginner's level Delphi programs. Click on the link within that page or scroll to page bottom to find the download links.
As a bonus, I finally took time to develop a simple way to remove that irritating highlight color drawn for every selected cell in a TStringGrid. I installed it for the two grids it in this program and like so much that I plan to add it to our DFFUtils utility library unit.
February 20, 2014: The Text Search program modifications which writes lines or portions of matching lines to a file was posted a couple of weeks ago. The fellow who requested likes the way it works, but we disagreed on what the default options should be. Text Search Version 2.1 resolves our differences by remembering options selected from run to run. Everyone is now happy.
February 9, 2014:
Brute Force is one of my favorite programs because it solves so many puzzles that can be expressed as algebra problems, including this one. We need to assign coins to the empty squares so that the sums match the given numbers. That requires 12 equations (5 rows, 5 columns, 2 diagonals) with 17 variables (the empty squares) with 4 possible values for each (empty, nickel, dime, quarter). The Brute Force button found the solution in about 30 minutes and verified that it was unique in 15 minutes more after searching all 17 trillion possible solutions.
Brute Force Version 3.0 fixes
a problem with Incremental Solving when multiple variables can
have the same value as in this puzzle . Incremental Solve works by
enumerating each valid solution for the 1st equation, then testing the 2nd
equation to see if there could be a valid solution given the trial solution for
the 1st, then the 3rd given 1st and 2nd, etc.
Once I fixed the problems that kept it from working on this case, the
Incremental Search button finds the unique solution in 0.05 seconds and takes an
additional 0.10 second to verify that the solution is unique!.
February 6, 2014: An error in the FastMult (Fast Multiply) procedure in our Big Integers unit was corrected today. The error was introduced in the November, 2013 update and returns invalid results multiplying integers of more that 1000 or so digits. The corrected UBigIntsV4 unit is available in today's posting in DFF library zip file DFFLibV14_6Feb2014. This introduces a new naming protocol for the library files to enable better tracking of minor updates.
The BigIntsTest program was also reposted to include the changed unit. As a matter of interest, FastMult is 4 to 5 times faster than the regular Mult procedure when multiplying two 50,000 digit integers (0.46 vs. 2.1 seconds, and the results now agree)!
February 5, 2014: Version 1 of the Text Search program was scanned a file and reported matches to a given string. TextSearch Version 2.0 posted today adds these user requested features:
February 1, 2014: Adapting programs to display properly across multiple screen resolutions is a persistent problem for programs which run on unidentified remote systems. I've made a start today by modifying several programs to display properly on screens from 1920x1200 (my system) down to 1024x720 (likely the lowest for LED screens). Links to changed programs are included at Screen Resolution Considerations in our Delphi Techniques section. Please let me know if you find truncated/overlapping display elements in these (or other) programs.
January 27, 2014: A change at our host site prevented DFF site updates and taken me several days to recover site formatting. If you run across format errors or missing or erroneous links, please drop me a line using the feedback link.
January 15, 2014: It didn't take long for a user to find a scaling bug in the MatchStick Puzzle for screen resolutions that don't match mine. It is always a problem when the program draws things (like match sticks) directly on the screen, especially when that fact slips the programmer's mind. I believe I have it fixed for most screens with today's posting. If not, let me know.
January 12, 2014:
back to the Mensa Page-A-Day calendar this year and the problems are much
more program-worthy than last year's puzzle calendar. Here's a
Matchstick Puzzle from the
January 2 page requiring you to "burn" segments of matches on a grid in
such a way that the number of burned segments in each column and row matches
given target values. The program makes it easier than pencil and paper
to burn and "unburn" match segments to solve the puzzle.
January 6, 2014: We visited our son and family in Alabama for Christmas and spent some time playing games including Scrabble. I'm a fairly smart guy, but most males, including me, are genetically handicapped when it comes to language skills and the girls (wife and granddaughter) beat my son and me soundly. Their Scrabble set includes a large book with all valid words and a 3 minute timer. We used most of our 3 minute turns frantically trying to verify that potential words were actually in the book. That led to today's Scrabble Search helper program. Given a set of available letters and information about where they might connect to words on the board, the program will list legal words to choose from. As the author, I claim the right to use it during games with family and to extend usage to other males in the game. Now if the girls will only agree J.
The What's New Archives
(Click to expand)
Copyright © 2000-2014 , Gary Darby
All rights reserved.