lundi 16 février 2015

Get full alphabet without using letters


After seeing the following code, I started wondering if there was a way to access the full lowercase alphabet without using any letters(conditions to be applied below):



[($=(!0)+'')[0]+$[1]+$[2]+((!1)+'')[3]+$[0],(([]+[])[1]+'')[1]+([]+{})[1],([]+{})[1]+(([]+[])[1]+'')[1]+$[3]].join(' ');
// "trust no one"


Using the various statements below the following letters can be accessed a b c d e f g i j l m n o p r s t u v x y:



// "true" yeilds: ertu
!0+'';

// "false" yeilds(previous excluded): afls
!1+'';

// "[object Object]" yeilds(previous excluded): bcjot
[]+{}+'';

// "undefined" yeilds(previous excluded): din
([]+[])[1]+'';
''[1]+'';

// "Infinity" yeilds(previous excluded): y
1/0+'';

// Using the above statements "constructor" can be spelled
// It has no value by itself but can be coupled with other statements to get more letters
($=[]+{}+'')[5]+$[1]+(([]+[])[1]+'')[1]+((!1)+'')[3]+($=!0+'')[0]+$[1]+$[2]+($=[]+{}+'')[5]+$[6]+$[1]+((!0)+'')[1];

// "function Array() { [native code] }" yeilds(previous excluded): v
([])[/*"constructor" from above*/]+'';

// "function Number() { [native code] }" yeilds(previous excluded): m
(0)[/*"constructor" from above*/]+'';

// "function String() { [native code] }" yeilds(previous excluded): g
('')[/*"constructor" from above*/]+'';

// "function RegExp() { [native code] }" yeilds(previous excluded): p x
(/./)[/*constructor" from above*/]+'';


What are ways to access to remaining characters h q w z with the following limits applied:



  1. Only non-letter characters can be used in the code(symbols, numbers and punctuation)

  2. All characters used within the code must fall into ASCII's first 128 characters

  3. Code must not rely on environment variables such as global for node, window for browsers, etc





Aucun commentaire:

Enregistrer un commentaire