# QWERTY Quine Creation

### Challenge

Create a quine, that instead of outputting it's source, output's it's source QWERTY-sorted.

### What is QWERTY sorting?

QWERTY sorting is sorting code by the QWERTY keyboard. Anything higher or more left is greater (q > Q, \ > /) with presedence on higher. To check, find the locations of the two characters to compare. Find which character occurs first in the following table (left to right, up to down). The first character is the smaller one.

qwertyuiop[]\
asdfghjkl;'
zxcvbnm,./
QWERTYUIOP{}|
ASDFGHJKL:"
ZXCVBNM<>?
1234567890-=!@#$%^&*()_+~  (there is a trailing space and linefeed) Examples: Code Golf -> eoodflGC Programming -> rroiagnmmP  (note trailing space on Code Golf) ### Specifications • Only characters in the above list are allowed in the source code! • This is . • Only Proper Quines are allowed (adapted to QWERTY sort). • Output must be in increasing QWERTY order. • You should make explicit that proper quines are required. – Dennis Apr 27 '16 at 15:31 • :D Jelly can't win this, it is mostly non-ascii!!! – Rɪᴋᴇʀ Apr 27 '16 at 15:35 • @ΈρικΚωνσταντόπουλος What part don't you understand? It reads pretty clear to me. – Morgan Thrapp Apr 27 '16 at 15:55 • Why is f > G > l? The keyboard diagram implies that all lowercase comes before all uppercase, but these examples imply that the upper and lower cases of a letter are right next to each other, i.e. qQwWeE... is sorted. – algorithmshark Apr 27 '16 at 16:15 • "Anything higher or more left is greater" - This is somewhat ambiguous, what about w and a? w is above a but also to the right of it? I think you need to say which takes precedence. – FryAmTheEggman Apr 27 '16 at 16:46 ## 1 Answer # CJam, 25 23 bytes {"_~"+{"#$_+~"#}$}_~  Thanks to @MartinBüttner for golfing off 2 bytes! Try it online! ### How it works { }_~ Define, copy and execute a code block.  Create a string representation of the code block. "_~"+ Append that string. { }$       Sort the characters by the following:
"#$_+~"# Compute the 0-based index of the character in that string. Returns -1 if not found. Since $' is stable, all characters with tied index -1
will appear at the beginning, in their original order.
This places {{}} at the beginning, followed by
""""##___++~~~.
`