Delphi For Fun Newsletter #21
Delphi For Fun Newsletter #21
Well, my ISP messed up this time and deleted previous newsletter subscriber info. I think it's all set up again so we'll give this a try. Computers are great, it's the programmers that usually screw things up.
Anyway, here are the "What's New" items since last time. Enjoy.
July 22, 2001: It's hard to find programs that are both simple and interesting, but here's a Beginner's level Check Digits program that seems to fit the bill. It validates credit card numbers that use the Modulo 10 check digit method. The program has 100 or so lines of code but about half are comment lines describing the format of MasterCard, Visa, Amex and Discover credit card numbers. They all use the same method to calculate that last digit, and we'll use the technique to verify that the number was entered correctly.
July 28, 2001: Test your reflexes with this Reaction Times program. It's a good candidate for a Science Fair project if you happen to have contact with anyone involved. Perhaps an opportunity to introduce some young person to the fun of programming at the same time. Subjects use mouse clicks or key presses to respond to targets flashed on the screen. The experiment designer defines the test parameters. There are lots of possible variables to test - one eye vs. two, which hand, target size/color/location, age of subject, etc. (If you try toe response time, expect some "stop cheating!" messages for clicking too soon.) Response time data is saved in a file for further analysis. I'm working on an "Intro. to Statistics" page that will help analyze Reaction Timer data files
July 31,2001: Posted a revision of the ReactionTimes program today. It includes two sample statistics programs - a DensityPlot program uses TChart to plot the distribution of response times. Also a ReactionStats program which uses Student's t-test to give insight about differences between average reaction times for 2 selected sets of data. No write-up yet, but if you know statistics, or want to, have a look. I've tried to avoid the statisticians lingo in order to make results understandable to us mere mortals. A few other changes were made to ReactionTimes to optionally create detail files and to clean up one or two data formatting errors.
August 6, 2001: Fibonacci was probably the greatest mathematician of the 13th century - his works were instrumental in converting Europe from the Roman numbers to the Hindu-Arabic system. His name is most commonly associated with the series of numbers formed by starting with 0 and 1 and then creating the rest of the series by adding the two prior members. What's amazing is that this series approximates the Golden ratio which frequently appears in nature including the arrangement of seeds in sunflower heads. (In the image at left the apparent overlapping seed spirals have 34 arms in one direction and 55 in the other, the 10th and 11th Fibonacci numbers.) Here's more of the story and a simple Delphi program that draws Fibonacci Sunflowers.
August 10, 2001: Here's version 1 of a Peg Solitaire game. I guess this version, in which the program does all of solving isn't exactly a game. More an example of the power of a simple depth first search to solve a problem. We can search about half a million board positions per second and surprisingly the typical problem is solved in only a couple of million position searches. Surprising because the number of board potential positions even for "Fireplace" is about 40 million and for "Diamond" is around 1027. Fortunately the number of positions actually reachable seems to be much smaller. Those two configurations are among the seven common initial configurations solved by this version. Oh yeah, there's also an animated playback of the solution once we find it.
In case you're not familiar with the game, the objective is to remove pegs by jumping them with another peg until the last peg is left in the center hole.
Version 2 with user play, (more fun for the user, but less fun for the programmer) will be along shortly.