Delphi For Fun Newsletter #12

[Home]

 

 
 
 
 
 
 
 
 
Tuesday  Feb 6,  2001
 
Delphi For Fun Newsletter #12
 
 
Here are the new items since last time.  Mainly updates of Wordstuff stuff using the new word lookup capabilities introduced last month.  Also a few beginners programs solving Squares and Cubes problems.   
 
I've been shopping for a loader/backhoe this past week.    After seeing prices, maybe I'll settle for a Delphi backhoe simulation.  I think I read that the standard game controller will support two joysticks, one to  raise, lower and swing the boom  and the other to control the position of the dipper and bucket.  The boom is the piece attached to the tractor and the dipper is the piece with the bucket on the end of it.    I know nothing about getting joystick inputs into Delphi, but that makes it sound even more fun.  Of course, I could write a much better simulator if I had an actual machine for practice...        

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 my version you match wits with the computer by finding all the words you can, then giving 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 here including 2 dimensional dynamic array handling, use of  the on.onidle event exit to perform background processing (finding words while the user is thinking),  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.      

January 31:2001:  Everything takes longer than I think it will.  I hope it's just a symptom of being an eternal optimist.  Here are 5  little programs bundled into a group I call Squares and Cubes  .  They all involve the finding integers whose squares and cubes satisfy some condition.   They are all small,  50 to 100 lines of code and mainly involve brute-force searching for solutions.   Here is #4, for example: : A Pythagorean triangle is a right-angle triangle whose sides are all integer values.   .  Find the smallest Pythagorean triangle whose perimeter is a perfect square and whose area is a perfect cube

The problem include samples of some Delphi  topics that you might want to check out.  e.g.

  • dynamic arrays  (arrays that can change size at run time) (#2)

  • the Format function. (#4)

  • Use of the TComboSet object (included) to generate all permutations of a set of digits. (#5)

  • Passing a procedure as a parameter.(#2)

  • The use of Windows accurate timing procedures QueryPerformanceFrequency and QueryPerformanceCounter to get microsecond resolution (#4).

Most or all of these problems  are from an excellent (and inexpensive)  little book: Math and Logic Puzzles for PC Enthusiasts , J. J. Clessa, Dover Books.   

January 24:2001:  Whew!  I spent the last few days battling a web page formatting problem.  FrontPage, the Microsoft program I use to build the site, does lots of automatic stuff to make the pages appear consistently.  One feature, shared borders, is great, but when Google provided some new insert code for it's search engine button, it totally confused FrontPage.   And, like many bugs, the problem went unnoticed for several days and the symptom had no apparent relationship to the change.  Anyway - Google search button is gone for a few days until I get it all straightened  out.        

WordStuff 2 is available.  I've added two new programs using the dictionary capabilities introduced in WordStuff 1.   Unscramble is an anagram solver.  The twist is that it finds two and three words phrases as well as single words.  Quite entertaining to see what phrases can be made from the names of grandkids or friends (or enemies).    Decrypt is a code solver.  It decrypts messages encoded with simple substitution encrypting,  if the words are in the dictionary that is.  It's kind of slow, but at least leaves lots of room for more exploration.    Finally, I wrote a "wrapper" program called WordStuff that handles dictionary loading and can run any of the three existing  programs: CrosswordHelper, Unscramble, Decrypt.  

A capitalization property was added to words in the dictionary, with the result that dictionary format has changed slightly.  CrosswordHelper was also change to accept '?' and '*' characters in the word mask, allowing it's use as a rhyming word finder, etc.   As a result, if you downloaded the dictionaries, or the DicMaint or CrosswordHelper programs introduced in WordStuff 1 before Jan 24,   please download them again.   

 

2775 visitors
 
_________________________
Gary
http://www.delphiforfun.org
_________________________
 
To subscribe or unsubscribe from this newsletter, go to http://www.delphiforfun.org/newsletter.htm
 
"Never stay up on the barren heights of cleverness, but come down into the green valleys of silliness."   Ludwig Wittgenstein (1889-1951), Austrian philosopher.