-3
1
Challenge
Return the full contents of your program, but inverted. How do your invert something? Well,
Letters: Take the position of the letter in the alphabet, subtract from 26, and use the letter at that position and flip the case of the letter. E.g A becomes z, and p becomes J.
Digits: Subtract from 9. E.g 6 becomes 3 and 5 becomes 4
Brackets: The brackets (){}[]<> become their corresponding closing/opening bracket. E.g [ becomes ] and > becomes <
Other
&and|swap.- ' ' [space] and '\n' [newline] swap.
£and$swap, as do€and¥¢and%swap_and-swap"and'swap?and!swap:and;swap/and\swap@and#swap~and`swap,and.swap©and®swap
All other characters become their Unicode inverse (subtract from 137,374). However, if the result is specified above, you must replace it again with the replacement provided. You only need to run a maximum of two replacements on each character, so no infinite loops.
Rules
- Standard loopholes are disallowed
"the final product cannot be inverted any more" - but if you have one of the defined replacements (e.g. a letter) you can always invert it? So what do you really mean – ASCII-only – 7 years ago
Also, I'd highly recommend against that arbitrary "at least 4 characters in length" restriction – ASCII-only – 7 years ago
Sorry, that was an oversight on my part. Fixed. – Geza Kerecsenyi – 7 years ago
The restriction on characters is just to avoid esoteric answers. – Geza Kerecsenyi – 7 years ago
3Sure... but I highly doubt there is (or ever will be) a language that can do this in 4 bytes, and even if so, the solution wouldn't be very interesting so it's not really a problem. 4 characters... maybe, if you count combining marks on the same character as a single character, but that doesn't matter since we count in bytes here – ASCII-only – 7 years ago
Removed char restrictions – Geza Kerecsenyi – 7 years ago
2Would have been much better if it were a little simpler, with fewer rules of inversion. But that's just my opinion (which I am not supposed to have). – Arjun – 7 years ago
1Why did you accept my answer?.. :S It's way too soon, and it's not even the shortest.. – Kevin Cruijssen – 7 years ago
150 bytes but can't answer because on hold – Nahuel Fouilleul – 7 years ago
R, 190 bytes; can't answer because on hold, but would like to see this challenge reopened. – Nick Kennedy – 7 years ago
bash +tr, 104 bytes – Nahuel Fouilleul – 7 years ago
1
Hi there! I see that this and your previous challenge have lots of comments beneath them asking for clarification or other improvements. Since you're rather new here, I would like to point out that we have a place for challenges to get refined before they get posted here. We call it The Sandbox. I've liked both of your challenges so far, so I hope you continue to stay on PPCG and enjoy all the time you spend here. :-)
– Giuseppe – 7 years agoThanks for the help @Giuseppe. I've heard of/seen the sandbox before, but wasn't sure how to use it. Thanks though - I understand now. – Geza Kerecsenyi – 7 years ago
Hi, I've edited your question to be a bit clearer. If there is anything I've done that you feel is not what you want, please correct me. In particular, I've removed the restrictions
Any reasonable language is fine,unless the \ is part of a control character, the whole thing with the monkey emoji and the [tag:kolmogorov-complexity] tag. Hopefully this can be reopened and the solutions in the comments can be posted :) – Jo King – 7 years ago