Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A competition to solve a particular problem through the usage and manipulation of strings.
0
votes
The redundant boolean
Clojure, 28 bytes
#(format "%031d" (if % 1 0))
Truthy is everything but nil and false
1
vote
There, I fixed it (with tape)
Clojure, 139 119 bytes
#(reduce-kv(fn[r x c](let[a(cycle "TAPE")i int d(-(i(nth(cycle %)(inc x)))(i c))](str r(if(> d 1)(apply str c(take(dec d)a))c))))""(vec %))
Anonymous function which take the string … Got rid of the pesky if statement by decrementing the difference. take produces an empty list if the number is 0 or less which in turn results in an empty string. …
1
vote
"DDoouubbllee ssppeeaakk!!"
Clojure, 25 bytes
(fn[s](apply str(map #(str % %)s)))
0
votes
Read color in my way
Clojure 1.8, 156 bytes
(fn[c o t](reduce #(str %(val %2))""(sort-by key(reduce-kv #(let[s(clojure.string/index-of t(nth o %2))](assoc %(if(contains? % s)(inc s)s)%3)){}(vec c)))))
Ungolfed
(fn [ …
3
votes
Alphabet cannon
Clojure, 417 319 bytes
(defn cannon[n](let[a(map #(char(+ 65 %))(iterate #(if(> % 24)0(inc %))0))m1(reverse(reduce #(concat %(repeat %2(- n %2)))[](range 0(inc n))))p1(map-indexed #(str(apply str(rep …
0
votes
Ten-pin bowling score - World Bowling edition
When reduceing over a String, each char is actually converted into a char - who would have thought. But this meany, I have to write \space and that hurts more than one can imagine. …