![]() Volume 9, Issue 3 Articles Tricks of the Trade In and Out Trott's Corner New Products New Publications Calendar News Bulletins New Resources Letters Classifieds Download This Issue Editorial Policy Staff and Contributors Submissions Subscriptions Advertising Back Issues Contact Information |
In and Out
In-flight PuzzleQ: This puzzle appeared in an in-flight magazine: In the following diagram, place the numbers 1 through 9 so that each row, column, and
How can I solve this using Mathematica? A: Bobby Treat (drbob@bigfoot.com) answers: Here is a naïve solution that depends on there being, at each stage, at least one cell that is fully determined and that does not check for contradictions. It works for the sort of problem you would expect to encounter in an in-flight magazine. Input the
PuzzleDisplay, written by David Park (djmp@earthlink.net), is used to display the puzzle.
The function SubSquare finds the
Excluded determines what values cannot be entered in the cell
Four values are excluded for the cell
OneChoice, applied to the cell
There is only one choice for the cell
Here is the iteration step, Iterate.
And here is the animated solution. You can use the Up and Down Arrow keys to step through the animation once it has started.
|
||||||||
About Mathematica | Download Mathematica Player © 2005 Wolfram Media, Inc. All rights reserved. |