Skip to main content
edited tags
Link
Ilmari Karonen
  • 20.8k
  • 4
  • 55
  • 100
Tweeted twitter.com/#!/StackCodeGolf/status/250520461040054273
Source Link
mikera
  • 1.3k
  • 9
  • 12

Can you Golf Golf?

You are required to generate a random 18-hole golf course.

Example output:

[3 4 3 5 5 4 4 4 5 3 3 4 4 3 4 5 5 4]

Rules:

  • Your program must output a list of hole lengths for exactly 18 holes
  • Each hole must have a length of 3, 4 or 5
  • The hole lengths must add up to 72 for the entire course
  • Your program must be able to produce every possible hole configuration with some non-zero-probability (the probabilities of each configuration need not be equal, but feel free to claim extra kudos if this is the case)