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 42827

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

2
votes
character then A :/[a-z]/?a # else, if it's a lowercase character then a :$_ # else the current character )..$_ # generate a sequenced string of … characters # that ends with the magic variable $_ # ($_ is currently a character from the array) }split// # split the magic variable $_ (currently the input string) # to an array of characters …
answered Oct 27 '15 by LukStorms
2
votes
Perl 5, 41 Bytes (40 + 1) Outputs 0 when a replacement couldn't be made. ($n,$s,$_)=split/:/;$_=0if!s/.{$n}/$&$s/ Test $ echo "6:Online :Hello World!" |perl -p -e '($n,$s,$_)=split/:/;$_=0if!s/.{ …
answered Oct 20 '15 by LukStorms
0
votes
Perl 5, 210 The code loads the input in an sorted array, and checks for each value against all values in the array that are 1 byte longer. map{@W=split//,$w=$_;map{@X=split//,$x=$_;if(@W+1==@X){$i …
answered Sep 28 '15 by LukStorms
1
vote
Perl 5, 230 214 @A=split(//,pop);$y=$m=256;map{$c=ord$_;$d=$c<=>$p;$t=$d>0?'/':$d<0?'\\':'-';$B[$x++][$y-=$d]=$t;$B[$x++][$y-=$d]=$_;$m=$y,if$m>$y;$M=$y,if$M<$y;$p=$c}@A;for$j($m..$M){for$i(1..$x){$s …
answered Aug 29 '15 by LukStorms
5
votes
Perl 5, 325 276 Using a bit of recursion to calculate the Levenshtein distance. @X=(P,e,r,l);$y=@Y=split//,pop;sub L{my($n,$m)=@_;return$m,if!$n;return$n,if!$m;my$c=$X[$n]eq$Y[$m]?0:1;(sort{$a<=>$ …
answered Sep 29 '15 by LukStorms
8
votes
Perl 5, 850 Lots of regex used or generated. The %l hash is used for repeated words. %l=qw(A avenge B _be_reached_for_comment C could D dude E pokedex G google_glass I _I_know K river_spirit L congr …
answered Oct 26 '15 by LukStorms
3
votes
Perl 5, 76 65 bytes A pinch of pure undiluted regular expressions. First finds what shouldn't be eaten. What remains is eatable. s/r(.*?)o(.*?)y(.*?)g(.*?)b(.*?)p/n$1n$2n$3n$4n$5n/g;s/[^n\s]/e/g T …
answered Sep 13 '15 by LukStorms
3
votes
Perl 5, 159 @c=(@b=(++$n,bottle.'s'x@-,of,beer),on,the,wall),s//Take one down and pass it around, @c. @c, @b. /,until/99\D+/;say$'."Go to the store and buy some more, $&" Based on the solution fro …
answered Nov 19 '15 by LukStorms
3
votes
Perl, 18 bytes say"Hello, World!" Remark: "say" is used in Perl 6. While "print" is a Perl 5 thing. But "say" can be used in version 5.10+ when the -M5.010 switch (or -M for a higher version) is …
answered Aug 28 '15 by LukStorms
17
votes
Piet, 93 codels The 1 pixel bitmap of the 31x3 program : There might be still some room for improvement. But the Direction Pointer & Codel Chooser are not making things easier. This is the 12 cod …
answered Sep 6 '15 by LukStorms
50
votes
Whitespace, 192 150 146 bytes Whitespace only needs spaces, tabs and linefeeds while other characters are ignored. Which can be troublesome to display on here. So in the code below the spaces & tabs …
answered Aug 28 '15 by LukStorms
3
votes
Perl 5, 243 bytes A shorter Perl 5 solution is posted as a community wiki solution here. $}=" bottle";$s='s';$o=" of beer";$w=" on the wall";$i=99;while($i>1){say"$i$}$s$o$w, $i$}$s$o.";$s=''if--$i< …
answered Nov 18 '15 by LukStorms