Five professional golfers (including Fiona) opted to wind down from a big match with a relaxing game of miniature golf at Richard’s Devilish Mini-Golf. They discovered, however, that mini-golf wasn't as easy as it looks. Each player scored extremely high on a different hole of the course, and eventually everybody was fuming about their loss and gave up. Using the clues below, can you find out each golfer's full name (one surname is Billings) and the hole he or she screwed up entirely?
1. George, Evans, and the one who blew it on the ball-eating Clown-Face all managed to control themselves after completing their worst hole and were able to return their putters intact.
2. Isaac’s bad luck came at the Stoplight, where the ball got caught inside, just out of reach of his club.
3. George and Hannah both scored quadruple bogies on their worst holes.
4. Ms. Derby and the man who screwed up on the Loop-de-Loop snapped their putters on nearby trees after their worst holes.
5. The one surnamed Chang wasn’t the one who hit a water hazard on the Viking Ship or the one who tallied a triple bogie on the Windmill.
6. Jacob Ambrose hit his ball with too much force on his worst hole, and took several strokes to get it out of the knee-deep sand trap and back onto the green.
Answer:
Fiona Derby, Windmill
George Billings, Viking Ship
Hannah Chang, Clown-Face
Isaac Evans, Stoplight
Jacob Ambrose, Loop-de-Loop
The following program (cloned from my all purpose WhoDunitBuster model) ran in zero elapsed time to find this as the only possible answer:
Imports System
Imports System.IO
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Math
Module Module1
Sub Main()
Randomize()
Dim strstarttime As String
Dim strendtime As String
Dim strend As String
Dim combos(0, 0) As Integer
Dim loopx As Integer
Dim size1 As Integer
strstarttime = TimeOfDay
Console.WriteLine("Start of execution: " & strstarttime)
size1 = 5 * 5 * 5
ReDim combos(size1, 3)
loopx = -1
For first As Integer = 0 To 4
For last As Integer = 0 To 4
For hole As Integer = 0 To 4
first_slice(first, last, hole, _
combos, loopx)
Next
Next
Next
Console.WriteLine( _
"loopx set to " & loopx)
For index01 As Integer = 0 To loopx - 4
For index02 As Integer = index01 + 1 To loopx - 3
fairway0102(combos, loopx, _
index01, index02)
Next
Next
strendtime = TimeOfDay
Console.WriteLine(" ")
Console.WriteLine("Start of execution: " & strstarttime)
strendtime = TimeOfDay
Console.WriteLine("End of execution: " & strendtime)
strend = "?"
Console.WriteLine(" ")
While strend <> "X"
Console.WriteLine("Please enter X to exit program...")
strend = UCase(Console.ReadLine())
End While
End Sub
Sub first_slice( _
ByRef first, ByRef last, ByRef hole, _
ByRef combos, ByRef loopx)
' Derby is female
' Derby is not the Loop-de-Loop
' Derby is not the Clown-Face
If last = 3 Then
If first <> 0 And first <> 2 Then
Exit Sub
End If
If hole = 1 Then
Exit Sub
End If
If hole = 0 Then
Exit Sub
End If
End If
' The Loop-de-Loop is male
If hole = 1 Then
If first = 0 Or first = 2 Then
Exit Sub
End If
End If
' George and Evans are not the Clown-Face
If hole = 0 Then
If first = 1 Then
Exit Sub
End If
If last = 4 Then
Exit Sub
End If
End If
' George is not named Evans
If first = 1 Then
If last = 4 Then
Exit Sub
End If
End If
' George and Evans are not the Loop-de-Loop
If hole = 1 Then
If first = 1 Then
Exit Sub
End If
If last = 4 Then
Exit Sub
End If
End If
'Isaac's was the Stoplight.
If hole = 2 Then
If first <> 3 Then
Exit Sub
End If
End If
' Chang was not the Viking Ship
If hole = 3 Then
If last = 2 Then
Exit Sub
End If
End If
' George, Hannah and Chang were not the Windmill
If hole = 4 Then
If first = 1 Or first = 2 Then
Exit Sub
End If
If last = 2 Then
Exit Sub
End If
End If
' Jacob's last name is Ambrose
If first = 4 Then
If last <> 0 Then
Exit Sub
End If
End If
loopx += 1
combos(loopx, 0) = first
combos(loopx, 1) = last
combos(loopx, 2) = hole
End Sub
Sub fairway0102(ByRef combos, ByRef loopx, _
ByRef index01, ByRef index02)
Dim indexes(2) As Integer
Dim intsub1 As Integer
Dim intsub2 As Integer
indexes(0) = index01
indexes(1) = index02
For index1 As Integer = 0 To 0
For index2 As Integer = index1 + 1 To 1
intsub1 = indexes(index1)
intsub2 = indexes(index2)
For index3 As Integer = 0 To 2
If combos(intsub1, index3) = _
combos(intsub2, index3) Then
Exit Sub
End If
Next
Next
Next
For index03 As Integer = index02 + 1 To loopx - 2
For index04 As Integer = index03 + 1 To loopx - 1
fairway0304(combos, loopx, _
index01, index02, _
index03, index04)
Next
Next
End Sub
Sub fairway0304(ByRef combos, ByRef loopx, _
ByRef index01, ByRef index02, _
ByRef index03, ByRef index04)
Dim indexes(4) As Integer
Dim intsub1 As Integer
Dim intsub2 As Integer
indexes(0) = index01
indexes(1) = index02
indexes(2) = index03
indexes(3) = index04
For index1 As Integer = 0 To 2
For index2 As Integer = index1 + 1 To 3
intsub1 = indexes(index1)
intsub2 = indexes(index2)
For index3 As Integer = 0 To 2
If combos(intsub1, index3) = _
combos(intsub2, index3) Then
Exit Sub
End If
Next
Next
Next
For index05 As Integer = index04 To loopx
fairway05(combos, loopx, _
index01, index02, _
index03, index04, index05)
Next
End Sub
Sub fairway05(ByRef combos, ByRef loopx, _
ByRef index01, ByRef index02, _
ByRef index03, ByRef index04, ByRef index05)
Dim indexes(5) As Integer
Dim intsub1 As Integer
Dim intsub2 As Integer
indexes(0) = index01
indexes(1) = index02
indexes(2) = index03
indexes(3) = index04
indexes(4) = index05
For index1 As Integer = 0 To 3
For index2 As Integer = index1 + 1 To 4
intsub1 = indexes(index1)
intsub2 = indexes(index2)
For index3 As Integer = 0 To 2
If combos(intsub1, index3) = _
combos(intsub2, index3) Then
Exit Sub
End If
Next
Next
Next
display_golfers(combos, indexes)
End Sub
Sub display_golfers(ByRef combos, ByRef indexes)
Dim intsub1 As Integer
Dim firstname As String
Dim lastname As String
Dim hole As String
Console.WriteLine(" ")
For index1 As Integer = 0 To 4
intsub1 = indexes(index1)
Select Case combos(intsub1, 0)
Case 0
firstname = "Fiona"
Case 1
firstname = "George"
Case 2
firstname = "Hannah"
Case 3
firstname = "Isaac"
Case 4
firstname = "Jacob"
End Select
Select Case combos(intsub1, 1)
Case 0
lastname = " Ambrose"
Case 1
lastname = " Billings"
Case 2
lastname = " Chang"
Case 3
lastname = " Derby"
Case 4
lastname = " Evans"
End Select
Select Case combos(intsub1, 2)
Case 0
hole = " Clown-Face"
Case 1
hole = " Loop-de-Loop"
Case 2
hole = " Stoplight"
Case 3
hole = " Viking Ship"
Case 4
hole = " Windmill"
End Select
Console.WriteLine(firstname & lastname & hole)
Next
Console.WriteLine(" ")
End Sub
End Module
Edited on January 7, 2005, 12:43 am
|
Posted by Penny
on 2005-01-07 00:40:07 |