Skip to content

Instantly share code, notes, and snippets.

View CodeGolfScotland's full-sized avatar

Code Golf Scotland CodeGolfScotland

View GitHub Profile

February 2017 - Print a Diamond Matrix

Task

Print a Diamond Matrix x numbers deep, x will always be greater than 0 and less than 10.

Examples:

(4) => 

January 2017 - Is it a leap year?

Task

Return a boolean true or false based on whether the given year is a leap year.

The given integer may be positive or negative.

Keep In Mind

December 2016 - Oh xmas tree, oh xmas tree

Task

Return an xmas tree n rows in length.

n will always be greater than 0.

Examples:

November 2016 - The Fibonacci Sequence

Task

Return the first N items of the Fibonacci sequence.

The input will be a whole number greater than or equal to zero.

The output should be iterable.

@CodeGolfScotland
CodeGolfScotland / October 2016 - Sum Mixed Array.md
Last active October 23, 2016 17:09
Code Golf October 2016

October 2016 - Sum Mixed Array

Task

Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers.

Return the answer as a number, not a string.

Examples:

September 2016 - Reversed Alphabet

Task

Reverse the alphabet so that abc => zyx and ABC => ZYX

Examples:

("code") => "xlwv" ("Golf") => "Tlou" ("1Avva8TT") => "1Zee8GG"

August 2016 - Rotate to the max

Task

Given a number, return the maximum value by rearranging it's digits.

Examples:

(123) => 321 (786) => 876 ("001") => 100 (999) => 999 (10543) => 54310

@CodeGolfScotland
CodeGolfScotland / july-2016-x-marks-the-spot.md
Last active February 6, 2017 08:36
Code Golf July 2016

July 2016 - 'x' marks the spot

Task:

Given a two dimensional array, return the co-ordinates of 'x'.

The co-ordinates should be zero indexed.

The solution should pass the example cases provided.

@CodeGolfScotland
CodeGolfScotland / leaderboard.md
Last active October 9, 2016 10:48
A list of winners and runners up.

Leader Board

September 2016 - Reversed Alphabet

Winner: Joaquín Ferrero (joaquinferrero) - Perl - 40

Runner Up: Abhishek Chanda (achanda) - Python - 51


@CodeGolfScotland
CodeGolfScotland / June-2016-sillyCASE.md
Last active January 25, 2017 11:55
The June 2016 challenge

June 2016 - sillyCASE

Task:

Create a function that takes a string and returns that string with the first half lowercased and the last half uppercased.

Example:

foobar => fooBAR