GithubHelp home page GithubHelp logo

espendk / schantznewyearscodingchallenge2016 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 2.34 MB

Schantz' New Year's Coding Challenge 2016 - https://www.linkedin.com/pulse/new-years-coding-challenge-espen-h%C3%B8jsgaard

Perl 76.13% PowerShell 0.16% Ruby 0.61% Makefile 0.42% Python 21.72% Scala 0.19% JavaScript 0.77%

schantznewyearscodingchallenge2016's Introduction

Schantz' New Year's Coding Challenge 2016

This repo contains solutions submitted to Schantz' New Year's Coding Challenge 2016 on LinkedIn. Only solutions where the author has granted express permission are included in this repo, and the solutions are organized by author.

The Challenge

The challenge as originally posted on LinkedIn was phrased as follows:

Write the shortest possible program that generates the lyrics of "Twelve Days of Christmas". Any language goes and, to encourage readability, white space does not count.

  1. The program should produce the lyrics as listed here (txt file).
  2. The lyrics must be output to stdout (output to stderr is ignored).
  3. Letter casing is significant.
  4. Line breaks may be encoded as line feed (LF), carriage return (CR), or any two-character combination of these.
  5. Programs may not take any inputs or access external resources. This includes, but is not limited to, arguments, files, and URIs.
  6. Use of any libraries is permitted, provided they are not made for or directed at this challenge.
  7. Programs should be runnable on a standard, reasonably modern Windows, Linux, or OS X machine using readily available tools.
  8. Time of submission will be used as tie breaker.
  9. Schantz will act as the benevolent dictator of the challenge and we will resolve any issues as we see fit, aiming at promoting a fun and fair challenge.

Extra Categories

A solution with a perfect score (0 characters) was submitted soon after the challenge was announced. This feat was achieved by using the Whitespace language (wiki page) which only considers spaces, tabs, and linefeeds significant. To keep the challenge interesting, two categories were added where the original rules were tweaked slightly to restrict the "abuse" of whitespace:

  1. Whitespace does not count
  2. Whitespace does not count, non-whitespace must be semantically significant
  3. All characters count.

Scoring

To make scoring manageable, a script was used to score submissions. However, as participants found different ways to exploit the intentionally loose phrasing of the challenge, writing this script was non-trivial.

We ended up using a Python3 script (definitive_size.py) which used auto detection of the encoding to count the number of characters in the program. This was to ensure that solutions, which exploited Unicode characters to pack information in few characters, were measured correctly. The downside was that programs with binary (non-Unicode) content got a slightly lower character count than if we counted bytes, but this was the most manageable solution we could come up with; Character encodings is a can of worms!

The script is a slight modification of a script kindly provided by Christian Iversen – thanks for letting us use it!

Results

Below are listed the author, character count, and language of the top 3 solutions in each of the three categories. Only the best correct solution from each participant in each category was taken into account. The solutions are all included in this repo.

##Category 1

  1. Christian Iversen: 0 characters in Whitespace
  2. Arvid Piehl Lauritsen Böttiger: 0 characters in Whitespace
  3. Christian Sonne: 10 characters in CJam

##Category 2

  1. Christian Iversen: 5 characters in GS2
  2. Christian Sonne: 10 characters in CJam
  3. Anders Nielsen Helmar: 30 characters in Perl

##Category 3

  1. Arvid Piehl Lauritsen Böttiger: 283 characters in Ruby
  2. Christian Sonne: 299 characters in Bourne shell + Pyth
  3. Christian Iversen: 306 characters in zsh

Picture of the winners

The winners of Schantz' New Year's Coding Challenge together with COO Stiig Berg Andersen: The winners of Schantz' New Year's Coding Challenge together with COO Stiig Berg Andersen

Credits

A big thanks to all the participants for taking up the challenge and submitting fun and interesting solutions in 18(!) different languages! Among the participants were (the rest chose to be anonymous):

  • Anders Nielsen Helmar
  • Andreas Kromann
  • Arvid Piehl Lauritsen Böttiger
  • Christian Iversen - see also his GitHub page for the challenge where he discusses his solutions
  • Christian Sonne
  • Erik Hansen
  • Jacob Kristensen

schantznewyearscodingchallenge2016's People

Contributors

espendk avatar

Stargazers

Rune Højsgaard avatar Arvid Böttiger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.