Fox & Hounds

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]

 

 

Search

Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.

 

Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. 

     

We receive a few cents from each purchase.  Thanks

 


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Mensa® Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa® 365 Puzzlers  Calendar 2017

Mensa® 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only

 

 

 

Problem Description

Rules from Wikipedia.org:

"This version (also called "Hounds and Hare") is played on an 8×8 checkerboard. As in draughts, only the dark squares are used. The four hounds are initially placed on the dark squares at one edge of the board; the fox is placed on any dark square on the opposite edge.

The objective of the fox is to cross from one side of the board to the other, arriving at any one of the hounds' original squares; the hounds' objective is to prevent it from doing so.

The hounds move like a draughts man, diagonally forward one square. The fox moves like a draughts king, diagonally forward or backward one square. There is, however, no jumping, promotion, or removal of pieces. The play alternates with the fox moving first. The player controlling the hounds moves only one of them per turn.

The fox is trapped and loses when a hound occupies all of its potential move squares."

Background & Techniques

Here's a first playable version of Fox & Hounds. Might be good to help explore strategies. So far to me, it looks like the Fox has a big advantage but a viewer thinks that,  as a 12 year old, he had a winning strategy for the Hounds.  If you find one, use the frrdback link below to let me know.

Drag/drop pieces to play. Press U key or click Undo button to undo a move. 

Within a game, boards can be saved and later restored, although "undo" info starts over when you do this.

This 1st posted version of Fox & Hounds was derived from TBoard object  in the Checkers game  previously added to DFF.   The 4 Hounds are defined as normal checker pieces and the Fox is initialized as a king so that he can move in any diagonal direction.    A Gameover function was added to detect when either the Fox or the Hounds had a winning position.   The Fox wins when his row is less than or equal to any of the Hounds.  The Hounds win when the Fox has no available moves.  Every game has a winner, there are no draws.

Most of the other changes were to eliminate the jumping and piece removal logic from the Checker TBoard version.   

Addendum August 9, 2007:  Version 2.1 posted today overcomes a big deficiency for those wanting to provide feedback on specific boards and games - there was no way to capture the information.  Board cells are now labeled and moves are displayed as they are made.   "Undo" has been augmented with a "Redo" button and keyboard key. "Save" and "Load" buttons now write or reload a text file with set of moves represent the current board  position.

Addendum September 1, 2007:  In the ongoing search for a winning strategy for the Hounds, Version 2.3 posted today allow the user to select who moves first.  Perhaps being able to have the first move is just the advantage that they need! 

Running/Exploring the Program 

bullet Download source
bullet Download  executable

Suggestions for Further Explorations

The biggest is to add a "Suggest" button, at least for the poor Hounds who seem to have a hard time cornering the Fox.   The button's suggestion will be based on an analysis of the current board position, probably as determined by a MinMax algorithm search result.  All depending of course on how we assign a "score" to each of the possible position choices as the game moves forward.    That's my current project unless someone else helps me out before I get it.  I'm not proud, I'll take all the help I can get!

 

Original Date: August 3, 2007

Modified: May 15, 2018

 

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2018, Gary Darby    All rights reserved.