New answers tagged

1

Husk, 20 bytes ?*¨H◄⁰ω]!¨L¹¨Ėr¨Λ='h Try it online! An if statement with compressed strings using This utility


1

K, 38 bytes {$[&/"h"=x;,/{"Hello World"}'x;"err"]} {..x..} defines a function with implicit arg x. $[cond; a; b] corresponds to a "if (cond) {a} else {b}" sentence The condition &/"h"=x can be read as "((string x).map(char is "h").reduce(and))" ,/{..}'xdefines a function that ...


0

Rockstar, 206 bytes listen to S X's0 while S at X let X be+1 listen to N if "+" is S at X-1 listen to I say N/1+I/1 else let D be N let P be N aint 1 while P and D-2 let D be-1 let M be N/D turn up M let P be N/D aint M say P Try it here (Code will need to be pasted in, with the programme as the first line of input and each integer on its own ...


0

Japt, 15 bytes Takes the programme as a character array, outputs true or false for the prime test. Ëø²?Vv j:Vv +Vv Try it (Header splits the programme into an array)


0

05AB1E, 234 - 8 = 226 DUuD'H'Qª9ª'+ªмgi“…ïƒËîéͼšÞ“.ª,q}vy'HQi”Ÿ™,‚ï!”,ëy'QQiX,ëy9QiтGтN-Dð«s≠i“Ïꀂ¬ž“«D𓀉€€íÒ,“««,'.«,“ƒ¶€µ„‹,î倕…¡,“.ª,тN-<Dð«s≠i<“Ïꀂ¬ž€‰€€íÒ.“ë<“±¥€‚¬ž€‰€€íÒ.“}«¶«ë“±¥€‚¬ž“«D𓀉€€íÒ,“««,'.«,“ƒ¶€µ„‹,î倕…¡,“.ª,“€¸Ïꀂ¬ž€‰€€íÒ.“.ª}, Try it online!


0

Rockstar, 84 bytes listen to S X's0 while S at X if "h" aint S at X say e say "Hello World" build X up Try it here (Code will need to be pasted in) Or, 67 bytes if we can take each character in the programme as a separate input: listen to S while S say "h" is S and "Hello World" or e listen to S


1

Rockstar, 208 168 bytes listen to S X's0 O's"" N's0 while S at X let C be S at X let N be+C is ";" if C is "#" let M be N/127 turn down M cast N-M*127 into N let O be+N N's0 build X up say O Try it here (Code will need to be pasted in) If we need to be able to handle newlines in the input then we'll need this 189 byte version ...


1

R, 79 76 bytes Edit: -3 bytes thanks to Giuseppe intToUtf8((attr(el(gregexpr(";*#",gsub("[^;#]","",scan(,"")))),"m")-1)%%127) Try it online! First deletes all non-;# characters from the input, then searches for the regex ;*#, which finds runs of ; characters followed by a # character. The match.length ...


Top 50 recent answers are included