Skip to content

Instantly share code, notes, and snippets.

@mathias-brandewinder
Last active May 4, 2016 13:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathias-brandewinder/301ac1fd91079398a460a54779b5cef7 to your computer and use it in GitHub Desktop.
Save mathias-brandewinder/301ac1fd91079398a460a54779b5cef7 to your computer and use it in GitHub Desktop.
F# Code Golf, round 1

Rules

Round 1: 45 minutes.

  • Smallest total score wins
  • Shortest solution for each problem gets 0 points, others score the difference from the best
  • 5 points bonus for each working tweeted solution on @fsibot

Show & Tell

Round 2: 30 minutes

  • Same scoring as Round 1

Problems

Easy: FizzBuzz

http://blog.codinghorror.com/why-cant-programmers-program/

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Medium: Collatz Conjecture

https://xkcd.com/710/ https://en.wikipedia.org/wiki/Collatz_conjecture

Take any positive integer n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to obtain 3n + 1. Repeat the process (which has been called "Half Or Triple Plus One", or HOTPO[7]) indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1.

Find the smallest positive integer that takes 5 iterations to reach 1

Hardcore: Source Code Ecological Footprint

http://codegolf.stackexchange.com/questions/58692/source-code-ecological-footprint

"Tweet test": footprint of "VW" ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment