Linked Questions
131 questions linked to/from Tips for golfing in Haskell
242
votes
450
answers
63k
views
Golf you a quine for great good!
Using your language of choice, golf a quine.
A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.
No cheating -- that means ...
92
votes
159
answers
13k
views
Determine whether strings are anagrams
Challenge
Given two strings, work out if they both have exactly the same characters in them.
Example
Input
word, wrdo
This returns true because they are the ...
227
votes
63
answers
19k
views
No A, just CAPS LOCK
What happens when the CapsLock key on your keyboard doesn't have a notch in it?
"This hPPENS."
The goal of this program is to consistently emulate keyboard misses where each A press is replaced with ...
105
votes
90
answers
24k
views
It took me a lot of time to make this, pls like. (YouTube Comments #1)
Hold up..... this isn't trolling.
Background
These days on YouTube, comment sections are littered with such patterns:
...
74
votes
139
answers
11k
views
Make a ;# interpreter
I recently created a new language called ;# (pronounced "Semicolon Hash") which only has two commands:
; add one to ...
90
votes
107
answers
13k
views
Count of "a"s and "b"s must be equal. Did you get it computer?
In the popular (and essential) computer science book, An Introduction to Formal Languages and Automata by Peter Linz, the following formal language is frequently stated:
$$\large{L=\{a^n b^n:n\in\...
77
votes
66
answers
19k
views
Sing Baby Shark
"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - ...
64
votes
51
answers
6k
views
The forbidden built-in
In the standard loopholes, the following is forbidden:
Claiming that your answer is written in "MyOwnLanguage", where the command x means "read a sequence of ...
59
votes
57
answers
6k
views
Increment an Array
Given a nonempty array of positive integers, "increment" it once as follows:
If all the array elements are equal, append a 1 to the end of the array. For example:
...
49
votes
67
answers
7k
views
Find the first duplicated element
Given an array a that contains only numbers in the range from 1 to a.length, find the first duplicate number for which the second occurrence has the minimal index. In other words, if there are more ...
39
votes
77
answers
6k
views
P Pr Pre Pref Prefi Prefix Prefixe Prefixes
Given some finite list, return a list of all its prefixes, including an empty list, in ascending order of their length.
(Basically implementing the Haskell function ...
37
votes
78
answers
3k
views
Remove character at specified index
(heavily inspired by Element of string at specified index)
Given a string s and an integer n representing an index in ...
46
votes
53
answers
8k
views
ETAOIN SHRDLU golf
Short and sweet description of the challenge:
Based off ETAOIN SHRDLU, your challenge is to write the shortest program or function in any language that outputs the 26 letters of the English alphabet ...
49
votes
51
answers
5k
views
Bit run rundown
Given an integer n > 0, output the length of the longest contiguous sequence of 0 or 1 in ...
75
votes
22
answers
20k
views
Draw the ☣ (Biohazard Symbol)
Draw the Biohazard symbol in an arbitrary colour on a distinctly coloured background. The specific proportions were published in the June 27th 1974 issue of the Federal Register of the US Government.
...