Invert a Quine!

We all know what a quine is. An inverted quine is a non-empty program that prints the inverse of its source code without reading its source code, and consists solely of printable-ASCII characters (space through ~).

Here, “inverse of the source code” means the following: the output of your program must contain each printable ASCII character (m − c) times, where c is the number of times said character occurs in your code, and m is the maximum number of times any character is repeated in your code.

(In other words: your code + your output = permutation of m times all of printable-ASCII.)

For example, if your program is 12345, then m = 1, and you should output any permutation of this string:

 !"#$%&'()*+,-./06789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~  If your program is AAB, then m = 2, and you should output any permutation of:  !!""##$$%%&&''(())**++,,--..//00112233445566778899::;;<<==>>??@@BCCDDEEFFGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ[[\\]]^^__aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~  Note how there are two missing As, and one missing B. Although a program that contains all the printable ASCII characters and outputs nothing is a valid inverse quine (satisfying m = 1), such an answer would not be very competitive, given its length. You are to write a program that is an inverted quine, as described in the above paragraph. As this is , the shortest program in bytes will win. Good luck! • Space, tab and newline? – Stewie Griffin Oct 18 '17 at 12:49 • You should highlight the duplicated for every repeated character in the source code it makes all the difference in the challenge – Rod Oct 18 '17 at 12:53 • Could you give an example of the inverse where multiple characters are repeated (and multiple times)? Say, 11234512345? – Giuseppe Oct 18 '17 at 12:55 • How is this a duplicate? Related, yes. Duplicate, no! It's way more difficult in languages where you have to have duplicate characters. Note that you can't just duplicate a string either, since the number of characters you must remove from each string is varying. – Stewie Griffin Oct 18 '17 at 15:55 • @StewieGriffin I would VTC this as "unclear" rather than a "dupe" because (nearly) every answer has a comment trying to figure out what duplicated for every repeated character in the source code means or if the submission is valid for that criterion, because the OP hasn't addressed quite a few of the questions here. – Giuseppe Oct 18 '17 at 17:02 6 Answers Brain-Flak, 221 207 bytes Includes +1 for -A (((((((()()()()){}){}()){}){})()){}{}){({}[()]<((((((()()()()){}){}){})<>[()()()])[()])((((()()()){})){}{})<>((()()()()){}){({}[()]<(({})())>)}{}({}()())<>{{({}<>[()]<(({})())><>)}{}<>(({}())()())<>}<>>)}{}  Try it online! # Push 206 (the number of times to duplicate the output) (((((((()()()()){}){}()){}){})()){}{}) # For 0 to 206 {({}[()]< # Push 32 on this stack and 18, 28 and 29 to the other # 18, 28 and 29 are the distances between the sets of braces ((((((()()()()){}){}){})<>[()()()])[()])((((()()()){})){}{})<> # For 0 to 8 ((()()()()){}){({}[()]< # Push TOS, TOS + 1 (({})()) # end For 0 to 8 >)}{} # Push TOS + 2 # skips '(' and ')' ({}()()) # For each value on the off stack (18, 28, 28) <>{ # For 0 to that number {({}<>[()]< # Push TOS, TOS + 1 (({})()) # End for 0 to that number ><>)}{} # Push TOS + 1, TOS + 3 (skips this set of braces) <>(({}())()())<> # End for each value on the off stack (18, 28, 28) }<> # End for 0 to 206 >)}{}  CJam, 17 bytes {s95c+'|,32>\-}_~  Try it online! Prints  !"#$%&()*./014678:;<=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^abdefghijklmnopqrtuvwxyz


Explanation

The goal was to modify the standard quine

{"_~"}_~


such that no character is repeated in the program. The reason for this is that CJam has a set different operator which we can use to remove characters from the printable ASCII range, but it doesn't take number of occurrences into account. Implementing that by hand would probably be longer, so I needed to make sure that every character appears only once and we don't have to worry about occurrences.

{      e# Quine framework. Executes the block while leaving another copy of the
e# block on the stack.
s    e#   Stringify the block, giving us "{s95c+'|,32>\-}".
95c  e#   Convert 95 to a character, which gives us '_' without repeating
e#   it in the source code.
+    e#   Append it to the string. We don't need to worry about '~', we'll just
e#   leave it out of the printable ASCII range to begin with.
'|,  e#   Get a character range from the null byte up to '{'. This omits "|}~",
e#   but those are in the program anyway, it doesn't matter.
32>  e#   Discard the unprintable characters.
\-   e#   Subtract the source string from the printable ASCII range.
}_~


print(~2/8,6>9)#!"$%&'*+14:;<=?@ABCDEGHIJKLMNOPQRSTUVWXYZ[\]^_bcdfghjkmoquvwxyz{|}  Try it online! Prints -0.375 False. 05AB1E, 9561 60 bytes (not 58 b/c I dislike that one) A?9L<J, !"'#$%&()*+-./:;=>@BCDEFGHIKMNOPQRSTUVWXYZ[\]^_{|}~


Try it online!

Old answer invalidated by "only-ASCII characters", a lot of commands aren't valid here.

It prints abcdefghijklmnopqrstuvwxyz012345678 one time as there are no duplicated characters.

Version with BCDEFGHIKMNOPQRSTUVWXYZ removed:

Work in progress... I think ~60 bytes is as low as you get without non-ASCII characters in 05AB1E..

• Also, if I'm indeed correct, you can also golf it to: interface Z{}//!"#$%&'()*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY[\]^_bdghjklmopqsuvwxyz|~ (97 bytes) – Kevin Cruijssen Oct 18 '17 at 14:37 Javascript (ES6), 103 101 bytes _=> !"#$%&'()*+,-.0123456789:;<?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^abcdefghijklmnopqrstuvwxyz{|}~//_=>\\


Old solution (103 bytes using alert)

alert;;alert\ \!"#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_bcdfghijkmnopqsuvwxyz{|}~  Old (invalid) solution (96 bytes) alert()// !"#$%&'*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_bcdfghijkmnopqsuvwxyz{|}~

• You have two //, which means you must output the printable characters, with one / removed. (I think) – Stewie Griffin Oct 18 '17 at 16:06
• @StewieGriffin Fixed – Herman L Oct 18 '17 at 16:25