Quantcast
Channel: Time to settle this: Java vs C++ - Code Golf Stack Exchange
Browsing latest articles
Browse All 6 View Live

Answer by dzaima for Time to settle this: Java vs C++

QuadR, 19 bytes _(.) [A-Z] \u1 _\l& Try it online!

View Article


Answer by GammaFunction for Time to settle this: Java vs C++

Zsh -oextendedglob, 82 69 51 bytes <<<${1//(#m)(_?|[A-Z])/${${MATCH[2]:u}:-_$MATCH:l}} Try it online! Try it online! Try it online! Even if the flags count toward byte count, adding 14 bytes...

View Article

Answer by Uri Granta for Time to settle this: Java vs C++

Python 3, 95 bytes First golf in a while. Comments welcome. lambda s:"".join(["_"*(x!=(l:=x.lower()))+l,x.upper()][p=="_"]*(x!="_")for p,x in zip("."+s,s))

View Article

Answer by Sara J for Time to settle this: Java vs C++

Retina, 40 bytes T`l`L`_. (?<!_)([A-Z]) _$L$1 _(?=[A-Z]) Try it online! Explanation T`l`L`_. # Replace lowercase letters with uppercase letters when after an underscore (?<!_)([A-Z]) # Replace...

View Article

Answer by Arnauld for Time to settle this: Java vs C++

Node.js, 61 bytes Contains the unprintable character \x7F. s=>s.replace(/_.|[A-Z]/g,s=>Buffer(s[1]||''+s).map(x=>x^32)) Try it online! JavaScript (ES6), 72 bytes...

View Article


Time to settle this: Java vs C++

Story In an unnamed company, some people use Java and some use C++. This was always a nuisance, and they kept on arguing which single language they should all be using. To settle the dispute, the...

View Article
Browsing latest articles
Browse All 6 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>