|
|
![]() |
|
"Closed" 6X6 Knight's Tour |
May 14, 2007: Today's update is to our
Knights Tour program , a program
that allows users or the computer to search for paths by which a chess
knight can visit every square on the board exactly once. The chess
knight can only move horizontally and vertically, two squares in one
direction and one square in the other. The last update in 2004 added
some features including closed tours (last move could make a valid move to
the starting square), starting the tour in a specified square, and
adding other constraints to the tour by requiring that specific moves land
on specific squares. This update, also at a user's request,
implements variable board sizes. I added 4x4 (no solution) to 12x12
board selection options to the program.
May 11, 2007: Every recreational programmers' repertoire should include some version of Conway's game of Life. Today's posting corrects that deficiency at DFF. John Conway defined the simple rules of the "game" in 1970. It is not actually a game at all, except for fun of designing initial patterns of occupied cells in a rectangular grid and watching them move, multiply and die off in successive generations created by two simple rules based on how many neighbors a cell has. For each new generation, occupied cells with 2 or 3 neighbors are happy, other occupied cells die. Empty cells with 3 neighbors give "birth" and become occupied. Here are two versions, a simple one for beginner programmers looking for simple programming examples, and one that has a few features to make it more playable.
May 4, 2007: Here is one definition of a "magic" sequence: A sequence of N integers with the property that, if the elements are assigned a rank from 0 to N-1 based on their position in the sequence, then each element represents the number of occurrences of its rank value in the sequence. Wrap your brain around that one for awhile! For example, for N=4 the sequence {1,2,1,0} is "magic" because it contains 1 zero, 2 ones, 1 two, and 0 threes. Can you find another sequence for N=4? My Magic Sequences program posted today generates more examples but is really a study in how to do it efficiently.
[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 2000-2008, Gary Darby
All rights reserved.
|