cools maths gamesSurprise me

Coding Golf

Pick clubs, read the wind and time a three-press swing to card a low score over 18 island holes.

Coding Golf title screen
  • Desktop recommended
Report a problem

Coding Golf is a full-length golf game viewed from straight overhead. You play as Fred, a golfer who slips onto the island course where he works, chasing the Broken Links trophy. Your goal is to finish all 18 holes in as few strokes as possible.

How Coding Golf Works

Each hole is a twisting green fairway surrounded by dark blue water, running from a red tee to a flag. A panel in the top left lists distance in yards, stroke number, par and your club. The orange aim line shows how far the current club carries.

The bag holds 19 clubs, from a 1 Wood that carries 278 yards down to a 10-yard putter. The swing takes three presses: one to start the meter, one to set power, and one to set accuracy as the needle swings back toward 0. Stopping between 0 and 5 gives a straight shot, past 5 hooks and below 0 slices.

Water sends the ball back to where you hit from and adds one penalty stroke. Wind direction and speed in mph appear in the top right and change after every shot.

Your First Few Minutes

  1. Press Space or click to start the round.
  2. Turn your aim with the left and right arrows until the orange line follows the fairway.
  3. Use the up and down arrows to pick a club that lands short of the water.
  4. Press three times: start, set power near the top, then stop near 0.
  5. Press S between shots to see the scorecard.

Controls for Coding Golf

Keyboard, mouse and touch controls for Coding Golf
To do thisKeyboardMouse
Start a round, close the scorecardSpace or EnterClick
Turn your aim left or rightLeft and Right arrowsScroll wheel
Change clubUp and Down arrowsnot used
Start the swing, set power, set accuracySpace or Enter (three presses)Click three times
Show the scorecardSnot used

What It Trains

Coding Golf rewards focus and steady timing. The third press needs a precise stop, and rushing it bends the ball.

There is planning and light math too. You compare yardage to club carry, adjust for wind and decide when two safe shots beat one risky one.

Strategy Notes

  • Adjust for headwind. A strong wind in your face shortens the ball, so go one club longer.
  • Never let the meter run past 100. It adds random sideways error.
  • Switch to wedges early. They carry 30 to 115 yards, while the putter only rolls 10.
  • Play the dogleg. A straight line to the flag often crosses water.
  • Watch for greenside sand. Many holes hide a bunker just in front of the green.

Good to Know

Coding Golf needs a keyboard for club changes, so it is not suited to phones. The scorecard splits the round into Out and Home nines. Music was removed on this site, and the golf itself is unchanged. Jasper Renow-Clarke (picosonic) made it for js13k in 2020.

Coding Golf questions and answers

How long does a round of Coding Golf take?

A full round is all 18 holes, and par for each runs from 3 to 6 depending on length. Expect a session of a fair length rather than a quick break, since every shot asks you to aim, pick a club and time the meter.

What decides the power of my shot?

Your second press locks power as the needle climbs toward 100. If the needle passes 100 before you press, the game sets the power itself and the shot drifts a little off line.

What does sand do to the ball?

A ball that lands in sand stops dead. Shots out of a bunker lose power and can wander up to about 10 degrees off your aim.

When does the ball count as holed?

It drops once it comes to rest within about 2 yards of the cup. You then see the hole result, such as Par, Birdie or Bogey, and the scorecard.

Try something from another shelf