neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


symbolicjs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
symbolicjs [2025/05/12 17:33] – [Build a basic alphabet] Yukisymbolicjs [2025/05/12 21:22] (current) Yuki
Line 63: Line 63:
 [,$___,$_$$$,$$___,$$,$_$_,$_,____$,____]={}+[], // o,b,j,e,c,t,space,O [,$___,$_$$$,$$___,$$,$_$_,$_,____$,____]={}+[], // o,b,j,e,c,t,space,O
 [$$$_$,$$_,$$_$$,$$$$]=![]+[], // f,a,l,s [$$$_$,$$_,$$_$$,$$$$]=![]+[], // f,a,l,s
-[,$$_$,$$$_]=!``+[], // r,u+[,$$_$]=!``+[], // r
 [__$]=-`!`+[], // N [__$]=-`!`+[], // N
-[,_$$,$_$,$$$_$,$$$,$_$,,,$_$__]=~[]/[]+[], // I,n,f,i,n,y+[,_$$,$_$,,$$$,,,,$_$__]=~[]/[]+[], // I,n,i,y
 [$$$_,,$_$$]=[][[]]+[] // u,d [$$$_,,$_$$]=[][[]]+[] // u,d
 </code> </code>
  
-Of course, a few of those are not needed, and can be removed if you don't need them, and those identifiers can always be shorter.+Of course, a few of those are not needed, can be removed if you don't need them, and those identifiers can always be shorter. We need at least enough to spell ''constructor'' and ''return btoa''. Here's the minimum: 
 + 
 +<code javascript> 
 +[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[], // o,b,e,c,t,space 
 +[,$$_,,$$$$]=![]+[], // a,s 
 +[,$$_$]=!``+[], // r 
 +[$$$_,$_$]=[][[]]+[], // u,n 
 +</code> 
 + 
 +<note>Note that we need the ''l'' for ''console.log'', and I'll put it back here, but it's shorter to move the ''i'' to the ''btoa'' call later in this document.</note>
  
 ===== Execute arbitrary code ===== ===== Execute arbitrary code =====
Line 85: Line 94:
 ===== Build more letters ===== ===== Build more letters =====
  
-We can then use `btoa` to get a lot of the letters we're missing:+We can then use `btoa` to get a lot of the letters we're missing, most notably ''h'' and ''i'' to spell ''return this'', and the ''g'' from ''log''.
  
 <code javascript> <code javascript>
-[K,C,g,h]=Function("return btoa`((!`")() // returns 'KCgh'+[K,i,g,h]=Function("return btoa")()`*(!` // returns 'Kigh'
 </code> </code>
  
 <code javascript> <code javascript>
-[,,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_+`\`((!\``)()+[,$$$,$__$,$$$$$]=$((_=$$_$+$$+$_+$$$_+$$_$+$_$+____$)+$_$$$+$_+$___+$$_)()`*(!`
 </code> </code>
 +
 +<note>
 +It's useful to save ''"return "'' for later here. You might want to use another variable name, though.
 +</note>
  
 ===== Build the global object ===== ===== Build the global object =====
Line 102: Line 115:
  
 <code javascript> <code javascript>
-_=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()+_=$(_+$_+$$$$$+$$$+$$$$)()
 </code> </code>
  
Line 115: Line 128:
 </code> </code>
  
-===== Final result =====+===== console.log example ===== 
 + 
 +<code javascript> 
 +[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[], // o b e c t space 
 +[,$$_,$$_$$,$$$$]=![]+[], // a l s 
 +[,$$_$]=!``+[], // r 
 +[$$$_,$_$]=[][[]]+[], // u n 
 +$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$], // $=Function 
 +[,$$$,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_)()`*(!` // i g h 
 +$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)() // $("return this")() 
 +[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___) // console.log("hello"
 +</code>
  
 <code javascript> <code javascript>
-[,$___,$_$$$,$$___,$$,$_$_$,$_,____$,____]={}+[],[$$$_$,$$_,$$_$$,$$$$]=![]+[],[,$$_$,$$$_]=!``+[],[__$]=-`!`+[],[,_$$,$_$,$$$_$,$$$,$_$,,,$_$__]=~[]/[]+[],[$$$_,,$_$$]=[][[]]+[],$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$],[,,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_+`\`((!\``)(),$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___)+[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[],[,$$_,$$_$$,$$$$]=![]+[],[,$$_$]=!``+[],[$$$_,$_$]=[][[]]+[],$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$],[,$$$,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_)()`*(!`,$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___)
 </code> </code>
symbolicjs.1747085624.txt.gz · Last modified: by Yuki