Skip to content
forked from aemkei/jsfuck

JSFuckr: encode JavaScript using only six chars ([+<])

License

Notifications You must be signed in to change notification settings

baboures/JSFuckr

 
 

Repository files navigation

JSFuckr: An esoteric language based on JSFuck

Try it online: https://baboures.github.io/tools/jsfuckr/

Features

  • You can encode JavaScript using only six chars ([+<])
  • It's a modification of JSFuck that uses < instead of !

How it works (see the full mapping or a step-by-step example)

// Primitives
'false':      '([]<[])'
'true':       '([]<[+[]])'
'undefined':  '[][[]]'
'NaN':        '+[[]<[]]'
'Infinity':   '+([+([]<[+[]])]+(([]<[+[]])+[])[([]<[+[]])+([]<[+[]])+([]<[+[]])]+[+([]<[+[]])]+[+[]]+[+[]]+[+[]])' // +"1e1000"
  
// Constructors
'Array':    '[]'
'Number':   '(+[])'
'String':   '([]+[])'
'Boolean':  '([]<[])'

// Alpha
'a': '(([]<[])+[])[+([]<[+[]])]'
'd': '([][[]]+[])[([]<[+[]])+([]<[+[]])]'
'e': '(([]<[+[]])+[])[([]<[+[]])+([]<[+[]])+([]<[+[]])]'
'f': '(([]<[])+[])[+[]]'
'i': '([([]<[])]+[][[]])[+([]<[+[]])+[+[]]]'
'l': '(([]<[])+[])[([]<[+[]])+([]<[+[]])]'
'n': '([][[]]+[])[+([]<[+[]])]'
'r': '(([]<[+[]])+[])[+([]<[+[]])]'
's': '(([]<[])+[])[([]<[+[]])+([]<[+[]])+([]<[+[]])]'
't': '(([]<[+[]])+[])[+[]]'
'u': '([][[]]+[])[+[]]'

// Numbers in the range 0-9
0: +[]
1: +([]<[+[]])
2: ([]<[+[]])+([]<[+[]])
3: ([]<[+[]])+([]<[+[]])+([]<[+[]])
4: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])
5: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])
6: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])
7: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])
8: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])
9: ([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])

// Numbers greater than 9
'10': +([]<[+[]])+[+[]]
'11': +([]<[+[]])+[+([]<[+[]])]
'12': +([]<[+[]])+[([]<[+[]])+([]<[+[]])]
'100': +([]<[+[]])+[+[]]+[+[]]
'123': +([]<[+[]])+[([]<[+[]])+([]<[+[]])]+[([]<[+[]])+([]<[+[]])+([]<[+[]])]
'314': ([]<[+[]])+([]<[+[]])+([]<[+[]])+[+([]<[+[]])]+[([]<[+[]])+([]<[+[]])+([]<[+[]])+([]<[+[]])]

Read compiler source

Packages

No packages published

Languages

  • JavaScript 86.4%
  • HTML 13.6%