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 29637

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

1
vote
PHP (216) (205) New version: $b=array_fill(65,26,' ');$b[80]=' ';$b=array_fill(0,$i,$b);for($j=--$i,$x=64;++$x<91;$i||$j=0){$b[$j][$x]=chr($x);$x==80&&$b[$j][$x]='PHP';$j+=($d=$j<($d?$i:1))*2-1;}e …
answered Jul 28 '14 by Christoph
2
votes
PHP, 30 27 <?=strtr($a=$argn,$a,$a^1); Changes every each char equal to the first char with the char that has the least significant bit flipped.
answered May 30 '17 by Christoph
3
votes
PHP + GNU Multiple Precision, 63 61 <?=gmp_export(gmp_init(substr(strtr($argn,$argn,"01"),2),2)); sadly the GMP extention is not default activated (but shipped). Run like this: echo "ABABABAAAAA …
answered Apr 23 '18 by Christoph
10
votes
10answers
! Isn't that awesome? The challenge Given a string assume it is terminated by a special character that is less than any other character in that string (e.g. smaller than even the null byte). Output … ). Example Given the string mmiissiissiippi output (when using L, S and *): LL*SLL*SLL*SLLL For example the first L is due to the fact that mmiissiissiippi$ is lexicographically greater than …
asked Jun 13 '17 by Christoph
4
votes
PHP, 51 50 47 for(;;usleep(5e5))echo$i++%2?"--:-- ":"12:00 "; 1 byte saved due to manatwork and another 3 saved by insertusernamehere. Thanks!
answered Jan 2 '17 by Christoph
1
vote
PHP, 82 byte, linear time for($a=$argn;a&$c=$a[$i-=1];$d=$c)$a[$i]=2+$t=$d<=>$c?:$t;echo strtr($a,[13=>12]); Walks over the input from right to left and replaces each char with the type. $t=$d<=>$ …
answered Jun 24 '17 by Christoph
3
votes
PHP, 95 93 89 87 <?=strtr(_1.intval([a6n,sot,c8c,lba,vf1,vf2][strlen($argn|aa)-2],33),_134256,$argn.=0); Basically @JörgHülsermann's answer but greatly golfed down so I decided to post it as a sepe …
answered May 30 '17 by Christoph
2
votes
Javascript, 57 55 setInterval('console.log(++i%2?"12:00":"--:--")',i=500) 2 bytes saved thanks to ETHproductions
answered Jan 2 '17 by Christoph
4
votes
PHP (61) <?=join(array_map('chr',array_map('bindec',explode(' ',$s))))
answered Jul 28 '14 by Christoph
5
votes
PHP, 68 66 for(;$i++<33;)echo$c=ڀ^" ".chr($i-7?16+$j++:1),mb_strtolower($c); slight improvement over the previous attempt by xoring instead of appending. ڀ^"\n" constructs the necessary "\0xd0\128 …
answered Jun 21 '17 by Christoph
1
vote
PHP, 16 echo" $argn"; run with php -R <code>. -R runs the given code for every input line and $argn is fed the current input line. So this simply prints each line with additional four spaces in …
answered Apr 10 '17 by Christoph
2
votes
version for(;a&$c=$argn[$i++];)trim($c,aA)?print($c^chr($f*ctype_alpha($c))):$f^=32; walks over the string and toogles a flag if the current char is a or A else the char gets toogled depending on the flag and echoed. …
answered Mar 16 '18 by Christoph
2
votes
(abused) PHP, 74 + 74 = 148 H@~*^)$.`~+1A|Q)p~`\Z!IQ~e:O.~@``#|9@)Tf\eT`=(!``|`~!y!`) Q~$x.4|m4~~&!L{% The PHP interpreter simply dumps the source code until it finds a <? since we lack < every per …
answered Jan 3 '17 by Christoph
5
votes
PHP, 27 <?=trim(32043**2,$argv[1]); uses the trick from Rod's answer to generate a string containing all digits then removes all digits except for the missing one. PHP, 41 for($b=1;$i<9;$b^=$argv[1][$i++]);echo$b; This one uses xor because I haven't seen it yet. …
answered Mar 28 '17 by Christoph