Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

0 votes

Explicit-ify APL expressions involving trains

Python3, 887 bytes: ...
user avatar
  • 2,520
3 votes

Determine Uilta Pitch Accent

Retina 0.8.2, 102 77 bytes ([^iu@oEOa][SZ]?)|. $#1$& ((1(.[SZ]?))?0(.)(?=.)(0.)?(1.[SZ]?)?(?!0))+.* $3$4 Try it online! Link includes test cases. Explanation: <...
user avatar
  • 143k
0 votes

Eh, codegolf shmodegolf

Runtslog, 821PB Ô¶©¥ Try It On The Internet.
user avatar
0 votes

Eh, codegolf shmodegolf

GeoGebra, 114 bytes ...
user avatar
  • 3,959
7 votes

Eh, codegolf shmodegolf

sed, 25 bytes /[aeiou]/s/[^aeiou]*/shm/ Try it online! /[aeiou]/ is a conditional that only runs the substitution ...
user avatar
  • 1,819
1 vote

Eh, codegolf shmodegolf

APL (Dyalog Extended), 31 bytes {⍵≢⍛≡n←⌊/⍵⍳'aeoiu':⍵⋄'shm',n↓⍵} Try it online!
user avatar
  • 81
1 vote

Eh, codegolf shmodegolf

Batch, 157 145 bytes ...
user avatar
  • 1,851
6 votes

Eh, codegolf shmodegolf

Powershell, 36 bytes $args-replace('^.*?([aeiou])','shm$1') Explanation Simple replace with a named group reference. +4 Thanks caird coinheringaahing -5 Thanks ...
user avatar
2 votes

Eh, codegolf shmodegolf

Pip, 15 bytes a~XVaH$(:"shm"a Attempt This Online! Explanation ...
user avatar
  • 31.8k
3 votes

Eh, codegolf shmodegolf

C (gcc), 81 bytes i;f(char*s){for(i=0;*s-"aeiou"[++i%6];i%6||s++);printf("shm%s"+3*!*s,s-i*!*s/6);} Try it online!
user avatar
  • 15.3k
1 vote

Eh, codegolf shmodegolf

C (gcc) with -m32, 90 85 83 bytes -2 thanks to ceilingcat ...
user avatar
  • 3,897
8 votes

Eh, codegolf shmodegolf

Stax, 11 bytes ÄFï¥░$º{═┘ç Run and debug it Left-trim consonants. If non-empty, prepend "shm". Else restore original input.
user avatar
  • 9,974
1 vote

Eh, codegolf shmodegolf

Lua, 39 bytes print((...):gsub("^.-%f[aeiou]","shm")) Uses the frontier pattern to shave off two bytes. String must be provided as argument, ...
user avatar
  • 475
3 votes

Eh, codegolf shmodegolf

SNOBOL4 (CSNOBOL4), 49 bytes I =INPUT I BREAK('aeiou') ='shm' OUTPUT =I END Try it online! BREAK "matches zero ...
user avatar
  • 26.7k
9 votes

Eh, codegolf shmodegolf

Haskell, 52 bytes snd.span(`notElem`"aeiou")>>=(?) ""?s=s r?_="shm"++r Try it online!
user avatar
  • 137k
2 votes

Eh, codegolf shmodegolf

Haskell, 58 57 bytes f s|g s>""="shm"++g s|1>0=s g=dropWhile(`notElem`"aeiou") Attempt This Online! -1 byte thanks to Wheat ...
user avatar
  • 4,236
2 votes

Eh, codegolf shmodegolf

Vyxal, 14 bytes k⁰øl:[`shm`p|_ Try it Online! Port of Jelly. How? ...
user avatar
  • 4,236
2 votes

Eh, codegolf shmodegolf

V (vim), 23 bytes :%s/.\{-}\ze[aeiou]/shm vim non-greedy regex with look-ahead. Try it online! Same in “magic very very” mode: 23 bytes ...
user avatar
  • 1,001
10 votes

Eh, codegolf shmodegolf

sed, 29 bytes s/[^aeiou]*\([aeiou]\)/shm\1/ Try it online!
user avatar
  • 18.1k
2 votes

Eh, codegolf shmodegolf

Java 8, 40 bytes s->s.replaceAll("^.*?([aeiou])","shm$1") Port of the JavaScript and Retina answers. Try it online. Or a minor alternative: ...
user avatar
1 vote

Eh, codegolf shmodegolf

Factor, 70 61 45 bytes [ R/ ^[^aeiou]*(?=[aeiou])/ "shm"re-replace ] Try it online!
user avatar
  • 8,928
3 votes

Eh, codegolf shmodegolf

Perl 5 + -p, 20 bytes Uses the ; separator (as ; is implicitly added via ...
user avatar
  • 22.1k
2 votes

Eh, codegolf shmodegolf

Charcoal, 25 bytes ≔⌕Eθ№aeiouι¹η¿⊕η«shm✂θη»θ Try it online! Link is to verbose version of code. Explanation: ≔⌕Eθ№aeiouι¹η ...
user avatar
  • 143k
3 votes

Eh, codegolf shmodegolf

C (gcc), 125 113 bytes -8 bytes thanks to @ceilingcat ...
user avatar
  • 1,282
4 votes

Eh, codegolf shmodegolf

Python, 53 bytes lambda s:re.sub("^.*?([aeiou])","shm\\1",s) import re Attempt This Online! Another regex answer. Alternative: Python, 53 bytes lambda s:re.sub(".*?(?=[aeiou])...
user avatar
  • 18.7k
10 votes

Eh, codegolf shmodegolf

Jelly, 16 12 bytes œlØḄṭ⁸¹?“shm Try it online! -4 thanks to ovs remembering there's a strip builtin ...
user avatar
2 votes

Eh, codegolf shmodegolf

Excel, 149 bytes ...
user avatar
  • 2,926
6 votes

Eh, codegolf shmodegolf

05AB1E, 28 13 bytes žNSÛ©ai®…shmì Try it online or verify all test cases. Explanation: ...
user avatar
3 votes

Eh, codegolf shmodegolf

JavaScript, 37 bytes s=>s.replace(/^.*?([aeiou])/,"shm$1") Try it online!
user avatar
  • 35.4k
5 votes

Eh, codegolf shmodegolf

Japt, 15 bytes r"^.*?%v"ÈÌi`¢m Try it (Includes all test cases)
user avatar
  • 35.4k
3 votes

Eh, codegolf shmodegolf

Zsh, 36 bytes <<<${(S)1/#(#b)*([aeiou])/shm$match} Attempt This Online! <<<: print ${1}: the input... ...
user avatar
  • 18.7k
3 votes

Eh, codegolf shmodegolf

Retina, 19 bytes Just a regex replacement, there might be some language feature which allows for a shorter solution. ^.*?(?=[aeiou]) shm Try it online!
user avatar
  • 53.4k
5 votes

Eh, codegolf shmodegolf

Python 3.8 (pre-release), 62 bytes lambda s:(q:=s.lstrip('bcdfghjklmnpqrstvwxyz'))and'shm'+q or s Try it online!
user avatar
  • 6,240
6 votes
Accepted

Implement FBLint

Python3, 2381 bytes: ...
user avatar
  • 2,520
14 votes

Ungolf my tinylisp code

tinylisp, 1022 bytes ...
user avatar
  • 27.6k
1 vote

Is this expression Python 2/3 safe?

TI-Basic, 44 bytes Input Str1 "0 For(I,1,9,2 Ans+sub(Str1,I,1 End fPart(expr(Ans)) or fPart(expr(Ans+"^0 uses the same approach than tsh's answer: The ...
user avatar
  • 4,824
1 vote

Is this expression Python 2/3 safe?

R, 61 59 bytes (or 52 bytes in R≥4.1 using \ instead of function) ...
user avatar
2 votes

Is this expression Python 2/3 safe?

Bash, 52 bytes Inspired by des54321's comment that said: I'm waiting for a competitive solution to this that isnt simply "eval the string as a python expression" I decided to "cheat&...
user avatar
1 vote

Is this expression Python 2/3 safe?

05AB1E (legacy), 9 bytes '/x.:‚.EË Try it online or verify all test cases. Explanation: Uses the legacy version of 05AB1E for two reasons: It's build in Python 3,...
user avatar
2 votes

Is this expression Python 2/3 safe?

R, 69 68 bytes Or R>=4.1, 54 bytes by replacing two function occurrences with \s. Edit: -1 byte thanks to @Dominic van Essen. ...
user avatar
  • 10.9k

Top 50 recent answers are included