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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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
Results tagged with Search options user 41042

A competition to solve a particular problem through the usage and manipulation of strings.

2
votes
Ruby, 30 bytes ->s{s.gsub(/((.)\2*)/){$1+$2}}
answered May 7 '17 by Cyoce
1
vote
J-uby, 3 bytes :[] [] is the subscripting operator. Example run: irb(main):001:0> f = :[] irb(main):002:0> f.call("string", 2) => "r" …
answered May 20 '17 by Cyoce
2
votes
PlatyPar, 0 bytes   Try it online At the beginning of the program, input is implicitly pushed to the stack. At the end of the program, the stack is implicitly printed.
answered Jan 15 '16 by Cyoce
0
votes
Ruby, 9 bytes proc &:[] How Ruby handles operator overloading is :+, :-, :*, :[], etc. are defined as methods, so 1+2 is essentially 1.+(2). :[] is the symbol for the subscripting "operator", whi …
answered May 20 '17 by Cyoce
0
votes
J-uby, 14 bytes ~:tr&'01'&'10' equivalent to lambda { |x| x.tr("01","10")}; literally replaces 1 with 0 and 0 with 1.
answered Oct 17 '17 by Cyoce
1
vote
J-uby, 19 18 bytes :=~&/^(..\n*)..$/m :=~& makes an anonymous function that takes x and returns 0 if it matches the regex /^(..\n*)..$/m, or nil otherwise.
answered May 26 '17 by Cyoce
2
votes
J-uby, 22 20 bytes -2 bytes thanks to @Jordan :tr&"... . . ..."&?. Explanation String#tr is Ruby's character-wise replace method. The first & binds :tr to "...\n. .\n...", and the second partially applies '.' to it. Effectively, this is ->s{"...\n. .\n...".tr('.',s)} …
answered May 11 '17 by Cyoce
3
votes
PlatyPar, 14 bytes "Hello, World! In PlatyPar (my language that is still in development), parens, quotes, brackets, etc. are automatically closed at the end of the line. Additionally, the last item …
answered Dec 13 '15 by Cyoce
35
votes
10answers
Disclaimer: while I have been on this site for entertainment purposes for a little while now, this is my first question, so please forgive any minor errors. Background When assigning us homework, my …
asked Dec 11 '15 by Cyoce
2
votes
PlatyPar, 14 bytes 'a'z_,X,F(x;l! Explanation (stack visualizer feature coming soon!): ## Implicit: push the input (as a string) to the stack 'a'z_ ## Push the range of a … -z (the alphabet) to the stack ,X ## Invert stack, expand input string into individual characters , ## Invert again F ; ## Fold (While stack.length > 1 …
answered Dec 15 '15 by Cyoce
4
votes
Ruby, 34 28 23 22 (+2 for -n) = 24 bytes 3 bytes saved thanks to Value Ink! 1 byte saved thanks to daniero loop{print;sleep$.*=2} Starts at 2, then 4, etc. Explanation -n …
answered May 8 '17 by Cyoce
1
vote
J-uby, 17 16 Bytes ~:gsub&' '*4&/^/ Explanation ~:gsub # :gsub with reversed arguments: # (f)[regex,sub,str] == str.gsub(regex, sub) &' '*4 # replace with f …
answered May 9 '17 by Cyoce
1
vote
Ruby, 22 21 Bytes 1 Byte saved thanks to @manatwork ->s{s.gsub /^/,' '*4} Takes s, replaces all occurences of /^/ (start of line) with four spaces.
answered May 9 '17 by Cyoce
1
vote
Cy, 21 18 bytes "Hello, World!" :< Cy is a new language I just made. It is stack-based/postfix, so the string "Hello, World!" must be pushed to the stack, then output it with the printing shortcut …
answered Mar 24 '16 by Cyoce
1
vote
J, 12 bytes '({.={:)*.*@# {. means start, = means equals, and {: means end. *.*@# means "logical and with the length of the string", i.e., if the length is 0, it returns 0. …
answered May 19 '17 by Cyoce

15 30 50 per page