org.jacop.examples.fd

## Class Golf

• ```public class Golf
extends ExampleFD```
A simple logic puzzle about golf players.
Version:
4.9

"A Round of Golf"

When the Sunny Hills Country Club golf course isn't in use by club members, of course, it's open to the club's employees. Recently, Jack and three other workers at the golf course got together on their day off to play a round of eighteen holes of golf. Afterward, all four, including Mr. Green, went to the clubhouse to total their scorecards. Each man works at a different job (one is a short-order cook), and each shot a different score in the game. No one scored below 70 or above 85 strokes. From the clues below, can you discover each man's full name, job and golf score?

1. Bill, who is not the maintenance man, plays golf often and had the lowest score of the foursome. 2. Mr. Clubb, who isn't Paul, hit several balls into the woods and scored ten strokes more than the pro-shop clerk. 3. In some order, Frank and the caddy scored four and seven more strokes than Mr. Sands. 4. Mr. Carter thought his score of 78 was one of his better games, even though Frank's score was lower. 5. None of the four scored exactly 81 strokes.

Solution Bill Sands Cook 71 Jack Clubb Maint 85 Paul Carter Caddy 78 Frank Green Clerk 75

Author:
Mariusz Czarnojan, Krystian Burka, and Radoslaw Szymanek

• ### Fields inherited from class org.jacop.examples.fd.ExampleFD

`cost, search, store, vars`
• ### Constructor Summary

Constructors
Constructor and Description
`Golf()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static void` `main(String[] args)`
It executes a simple program to solve this logic puzzle.
`void` `model()`
It specifies a standard way of modeling the problem.
• ### Methods inherited from class org.jacop.examples.fd.ExampleFD

`creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Golf

`public Golf()`
• ### Method Detail

• #### model

`public void model()`
Description copied from class: `ExampleFD`
It specifies a standard way of modeling the problem.
Specified by:
`model` in class `ExampleFD`
• #### main

`public static void main(String[] args)`
It executes a simple program to solve this logic puzzle.
Parameters:
`args` - no arguments is used.

Copyright © 2022. All rights reserved.