February 26, 2001: Perfect, Amicable, and
Sociable numbers are the subject of today's program , AliquotSums.
And you'll learn a new word as a bonus.
February 21, 2001: Another addition to the
Delphi Techniques section. I posted today an integer list
counterpart to Delphi's TStringList, a useful string list
component. I could have used TIntList in many
previous programs but really needed it for the current project, (perfect,
amicable and social numbers).
Go
here to check out the new TIntList class.
February 18, 2001: I finally got tired of
manually adding code to validate numeric input from the user. Today I
added visual components TIntEdit and TFloatEdit to
replace TEdit when numeric entry is required. These are not
very sophisticated but they are small and seem to do the job.
You can check them out and download from this
Delphi Techniques page . This might be the time to
experiment if you haven't yet played with writing your own
components.
February 17, 2001: A Delphi version of Mastermind,
the famous game with the objective of finding a secret pattern
of colored pegs is ready to enjoy. And if you think discovering
the pattern is challenging, wait 'till you try to understand how the
program solves it. The algorithms, largely from the algorithm lover's
best friend - Professor Donald Knuth, are great fun to
study. Have at it!
February 11, 2001: Today's contribution is a
version of the Eight Queens problem that I call Eight
Queens Plus. The traditional Eight Queens problem asks you
to place 8 queens on a standard chessboard in such a way that no queen can
attack another. This is equivalent to requiring that no queens be in
line vertically, horizontally or diagonally. This version requires,
in addition, that no queen occupy either of the two main diagonals.
There are 3 versions of the program, Version 3 finds multiple solutions,
has a graphic display of the board and allows user play. It
has about 500 lines of code and so qualifies as advanced under our size
criteria, even though the code is not particularly complex. The
first 2 versions are considerably smaller.
February 5, 2001: Akerue
is ready! This is a word-finder game where you try to find as
many words as possible in a random array of letters. The name
is based on a Turbo Pascal version published by Borland as part of a
package called Word Wizard about 15 years ago. In this version
you match wits with the computer by finding all the words you can, then
give the computer a chance. If he can't find enough words that you
missed to get a higher score, you win! Akerue's score
usually exceeds mine by a factor of 10.
Some new (for this site) Delphi features are introduced
including 2 dimensional dynamic array handling, use of Application.OnIdle
event exit to perform background processing, and the use of TMediaPlayer
to provide some audible feedback to the user as he finds words.
I also discovered this week that a unit used by Crossword
Helper doesn't seem to be included in Delphi Standard. I've
updated the source zip file to include masks.dcu. If
you have Pro or Enterprise versions, you don't need it. If you have
Delphi Standard, save up the extra $ to upgrade - it's worth it just
for what you'll learn browsing the included source
code.
|