CMC: Create a non-empty cat program, and, in the same language, a (non-empty) reverse cat program (i.e. reverse the input). Your score is the Levenshtein distance between the two programs. Lowest wins, and the two programs may not (somehow) be identical.
Challenge :
Check :
if there are exactly n exclamation marks ! between every pair
and whether their sum equals to 10.
Input :
A string of arbitary length.
The number of exclamation marks to check for
Output :
if there are exactly n exclamation marks between each pair, return truth...
Decoding the Kaadi system
code-golf string parsing alphabet
You have come across an old Indian manuscript, one that describes mounds of buried treasure. The manuscript also tells you the location of the treasure, except that some crucial numbers have been encoded indirectly into the text. You f...
@cairdcoinheringaahing JS, f=c=>"!"? c : [...c].reverse().join('') & f=c=>""? c : [...c].reverse().join(''). You should've added bytecount as secondary scorer.
@cairdcoinheringaahing Keep in mind that [...] changes the value but has no side-effect
One nice way to think of brain-flak is that every atom has a value and a side-effect. So (...) has the side-effect of pushing n, but the value is just n (no change). Whereas [...] has no side-effect but the value is -n and <...> has no side-effect and the value is 0 (which is surprisingly useful)
@H.PWiz let me get this straight, d≡n**3/p*7%10*p≡(n**3-3)/p*7%10*p (backing up)≡7*(n**3-3)%p (you remove the division, now you take mod p because that is equivalent to taking mod 10 on d after dividing by p) tada
@cairdcoinheringaahing It lets you get at values under the TOS. So without it, if we wanted to duplicate 'b', then when we push back 'a', the value of duplicating 'b' is 'b', so it pushes back 'a+b' instead of 'a'.
For example, ({}(({}))) turns [a, b] into [a+b, b, b]. But ({}<(({}))>) turns [a, b] into [a, b, b]
So the first {} pops a, then the <(({}))> is executed, which pops b, then pushes it twice, then a+0 is pushed back to the stack with the outer (...). So shouldn't that make [a, b] => [b, b, a]?
@Cowsquack Pretty much, except you're really calculating 10**k*d. I didn't get it by directly modifying ASCII-only's answer, but just thought of it because n**3 is 10**k*(10*a+b)+3 where b is what you want to multiply by 7
@cairdcoinheringaahing I think this might make for a nice challenge if the code length is also incorporated into the score, because it's probably rather easy to do something like if" ">""then id else reverse in most languages.
@cairdcoinheringaahing BTW, without <...>, it's still possible to do the same thing. <...> just makes it more convenient. Without it, we could do this: Try it online!
:D @H.PWiz I think the new method will be pretty useful for quite a few of the submissions (well, at least the java one I guess? nvm. xnor's answer blew mine out of the water >_>