# Question
Title: Proving you are the best StackExchange-User
## Write one/two program(s)/function(s):

1. The first one should return a truthy value if given your Stack Exchange username.

### ~~Optional~~

2. An obfuscated one (as explained below) that does the same thing.

### Rules for number 2:

1. May be no more than ten times the byte-count of number 1 or 100 bytes, whichever is higher.
2. Must be written in the same language as number 1.

# Test cases

(for my case:)

```
input        output
-------------------
Seims        true
BestCoderXX  false

```

### Winning

This is , so shortest byte count for number one wins.

# Answer
> 10 votes
# JavaScript

```
[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]+(+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(![]+[])[+[]]+(!![]+[])[+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(![]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]])()(+[]+[+[]]+(+[![]])+![])[+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(![]+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(![]+[])[!![]+!![]+!![]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+!![]])()+[])[+!![]+[+!![]]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[!![]+!![]+!![]]]+(+!![]+[+!![]]+(!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+[])+![]+(!![]+!![]+!![])+(!![]+!![])+![]+(+!![])+(+[])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+!![])+![]+(+!![])+(+!![])+(+[])+![]+(!![]+!![]+!![]+!![])+(+[])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+!![])+![]+(+!![])+(!![]+!![])+(!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+[])+![]+(!![]+!![]+!![])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(!![]+!![])+(+[])+![]+(+!![])+(+[])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+[])+![]+(+!![])+(+[])+(+[])+![]+(+!![])+(+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(+[])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+[])+![]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+!![])+![]+(+!![])+(+[])+(!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+[])+(!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+![]+(+!![])+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]))[(![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[+[]]](![])+(+[]+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]])())()

```

To run:
Open the console (`Ctrl + Shift + I`)
Type `f =`
Paste the above

To use:
`f('the string you want to test')`

## EDIT: fixed ES6 version below

```
[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]+(+(+!![]+[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+!![])+(+[]))+[])[+!![]]+(![]+[])[+[]]+(!![]+[])[+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([]+(+[])[([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(![]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]])()(+[]+[+[]]+(+[![]])+![])[+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(![]+[])[+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(![]+[])[!![]+!![]+!![]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+!![]])()+[])[+!![]+[+!![]]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([![]]+[][[]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[!![]+!![]+!![]]]+(+!![]+[+!![]]+(!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+[])+![]+(!![]+!![]+!![])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+![]+(+!![])+(+[])+(+[])+![]+(+!![])+(+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(+[])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(+!![])+(!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+[])+![]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![])+![]+(+!![])+(+[])+(+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![]+!![])+(+[])+![]+(!![]+!![]+!![]+!![]+!![])+(!![]+!![])+![]+(!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(!![]+!![]+!![]+!![])+(+!![])+![]+(!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+!![])+(!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+![]+(+!![])+(+[])+(+!![]))[(![]+[])[!![]+!![]+!![]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]]+([][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()+[])[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(![]+[])[+!![]])()([][[]]))[+!![]+[+[]]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[+[]]](![])+(+[]+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!![]+[+[]]])())()

```

Note: This checks equality with the username of whoever runs it, not my username

# Answer
> 8 votes
# Python 2 (Non-Competing)

*This was posted before the rules were changed significantly.*

```
False = True; True = False; True = True; print (`'Riker'.lower().upper()`=="Riker" and "Riker" == `raw_input()`) <> True and raw_input()=="Riker"

```

# Answer
> 5 votes
# Javascript

```
eval(function(B,á,l,i,n,t){if(n=function(B){return B},!"".replace(/^/,String)){for(;l--;)t[l]=i[l]||l;i=[function(B){return t[B]}],n=function(){return"\\w+"},l=1}for(;l--;)i[l]&&(B=B.replace(new RegExp("\\b"+n(l)+"\\b","g"),i[l]));return B}('3 4(0){2(!(0=="9á5")){{1 7}}6{{1 8}}}',10,10,"notMyName|return|if|function|HELLO_WORLD|lint|else|false|true|B".split("|"),0,{}));

```

I first created a half-readable code, then I ran it trough RegPack, then an obfuscator, then a minifier, then RegPack again, and lastly a different minifier.

Note: RegPack is worse than an obfuscator

Made a slight modification on variable names after @LeakyNun pointed out something

# Answer
> 5 votes
# Python 2 (Non-Competing)

*This was posted before the rules were changed significantly.*

```
print raw_input()=="Eᴀsᴛᴇʀʟʏ Iʀᴋ"

```

Quite obfuscated to non-programmers or people who only code in brainfuck.

@Downvoters: Also serves to point out the definition of "obfuscated" needs to be fixed.

# Answer
> 4 votes
# Pyth

```
q1409257787840474805614C

```

Test suite.

Encodes the input string in base-256, and then check if it is equal to `1409257787840474805614`.

# Answer
> 4 votes
## 05AB1E

```
žnžo‡"Vnrtmz"Q

```

Uses the Atbash cipher.

Try it online

# Answer
> 4 votes
# Java

```
public boolean eval( String username )
{
    int s = 2304854;
    int w = 1660790;
    String r = "";
    int l = username.length();
    int b = 0;
    Random ra = new Random( s );
    boolean sw = false;
    for ( int i = 0; i < l; i++ )
    {
        if ( !sw && i > 5 )
        {
            sw = true;
            ra = new Random( w );
        }
        int ran = ra.nextInt( 25 ) + 97;
        b |= ( ( i == 5 ? ' ' : ran - ( ( i == 0 || i == 6 ) ? 32 : 0 ) == username.getBytes()[ i ] ? 1 : 0 ) << i );
    }
    return b == 2015 && l == 10;
}

```

# None- Golfed

```
public boolean isShaunWild(String name){
    return name.equals("Shaun Wild");
}

```

Just a bit of fun haha. Horribly unreadable and hard to understand what it is without reading through it a couple of million times :<sup>)</sup>

# Answer
> 3 votes
# Oracle SQL 11.2

Returns 0 if true, 1 if false

```
SELECT SIGN(ABS(TRUNC(SUM(ASCII(SUBSTR(:1,LEVEL,1))*POWER(10,LEVEL*(LENGTH(:1)-1.14265533)))/CEIL(AVG(LEVEL))-
       CEIL(AVG(POWER(ASCII(SUBSTR(:1,LEVEL,1)),6.42)))+76158.880743588573892)))
FROM DUAL CONNECT BY LEVEL<=LENGTH(:1)

```

# Answer
> 3 votes
## Perl 5

```
eval eval '"'.('`'|'%').('['^'-').('`'|'!').('`'|',').('{'^'[').('['^'.').('`'|'.').('['^'+').('`'|'!').('`'|'#').('`'|'+').('{'^'[').('['^'.').'='.'>'.('['^'*').'\\'.'{'.'_'.(';'&'=').('^'^('`'|')')).(';'&'=').('`'^'!').';'.'\\'.'"'.'!'.('{'^'.').';'.('`'^"'").'!'.('`'^'!').(':'&'=').('{'^'-').('`'^',').('`'^'"').('^'^('`'|')'))."'".'\\'.'@'.('{'^',').'-'.('^'^('`'|',')).'('.('`'^',').'('.('`'^'%').('{'^'*').('{'^'#').'-'.('^'^('`'|'*')).(';'&'=').'<'.'>'.'#'.'('.('{'^'"').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.('^'^('`'|'+')).('{'^'*').('{'^'#').'-'.('^'^('`'|'*')).'-'.'<'.'>'.'#'.('^'^('`'|'+')).'\\'.'$'.('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'.')).('^'^('`'|'+')).('{'^'*').('{'^'#').','.('`'^'#').'-'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^'+').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').('^'^('`'|'/')).('^'^('`'|'+')).('{'^'*').('{'^'#').','.('{'^'(').('`'^'%').'<'.'>'.'#'.','.('{'^',').'_'.('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.'%'.('{'^'*').('{'^'#').'-'.'#'.')'.'<'.'>'.'#'.','.('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.('{'^'.').('{'^'*').('{'^'#').'-'.'#'.'!'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^'.').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').','.('`'^'#').('^'^('`'|'+')).'<'.'>'.'#'.('^'^('`'|'*')).('{'^'*').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').'.'.'%'.('{'^'*').('{'^'#').','.('`'^'$').('^'^('`'|'/')).'<'.'>'.'#'.('^'^('`'|'.')).('{'^'(').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.('^'^('`'|'+')).('{'^'*').('{'^'#').','.('{'^'/').'-'.'<'.'>'.'#'.'-'.'%'.('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'_'.','.('{'^'.').('{'^'*').('{'^'#').','.('{'^'/').'-'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^'.').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'-'.('{'^'.').('{'^'*').('{'^'#').','.('`'^'#').'='.'<'.'>'.'#'.('^'^('`'|'.')).('{'^'+').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').'-'.('`'^'%').('{'^'*').('{'^'#').','.('{'^'(').('`'^'!').'<'.'>'.'#'.('^'^('`'|'*')).('{'^'.').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').','.('^'^('`'|'+')).('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).('`'^'!').'<'.'>'.'#'.')'.'#'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'/').','.('{'^'.').('{'^'*').('{'^'#').','.('`'^'#').'%'.'<'.'>'.'#'.'-'.'#'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'/')).('^'^('`'|'+')).('{'^'*').('{'^'#').'_'.','.('`'^'#').'-'.'<'.'>'.'#'.','.('{'^'/').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').','.'%'.('{'^'*').('{'^'#').','.('{'^'(').'='.'<'.'>'.'#'.'('.('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^'/').','.'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).(';'&'=').'<'.'>'.'#'.')'.'%'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'-'.('^'^('`'|'+')).('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).'%'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'/')).'%'.('{'^'*').('{'^'#').'-'.'#'.'-'.'<'.'>'.'#'.')'.'\\'.'$'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').','.('{'^'/').('^'^('`'|'+')).'<'.'_'.'>'.'#'.'('.('{'^'(').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'.'.'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).'%'.'<'.'>'.'#'.','.('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.('{'^'.').('{'^'*').('{'^'#').'-'.'#'.'!'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').'-'.'#'.('^'^('`'|'+')).'<'.'>'.'#'.('^'^('`'|'*')).('{'^'*').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').'.'.'%'.('{'^'*').('{'^'#').','.('`'^'$').('^'^('`'|'/')).'<'.'>'.'#'.('^'^('`'|'.')).('{'^'(').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').','.'%'.('{'^'*').('{'^'#').'-'.'#'.')'.'<'.'>'.'#'.')'.'!'.'_'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').','.('{'^'.').('{'^'*').('{'^'#').'-'.('^'^('`'|'*')).'-'.'<'.'>'.'#'.('^'^('`'|'.')).('{'^')').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'-'.('{'^'.').('{'^'*').('{'^'#').','.('`'^'#').'='.'<'.'>'.'#'.('^'^('`'|'.')).('{'^'+').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').'-'.('^'^('`'|'+')).('{'^'*').('{'^'#').','.('`'^'$').('^'^('`'|'/')).'<'.'>'.'#'.'('.('{'^'.').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').','.('^'^('`'|'+')).('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).('`'^'!').'<'.'>'.'#'.('^'^('`'|'.')).('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'/')).'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).'-'.'<'.'>'.'#'.'('.('{'^'"').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'_'.('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').','.('{'^'/').('^'^('`'|'+')).'<'.'>'.'#'.'('.('{'^'(').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).('^'^('`'|'+')).'<'.'>'.'#'.','.('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').'-'.('{'^'.').('{'^'*').('{'^'#').'-'.'#'.'!'.'<'.'>'.'#'.('^'^('`'|'*')).('{'^'-').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'/')).'%'.('{'^'*').('{'^'#').','.('{'^'(').')'.'<'.'>'.'#'.'('.('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').('^'^('`'|'.')).('^'^('`'|'+')).('{'^'*').('{'^'#').','.('`'^'#').('`'^'!').'<'.'>'.'#'.('^'^('`'|'.')).('{'^'.').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').','.('^'^('`'|'+')).('{'^'*').('{'^'#').'_'.'-'.('^'^('`'|'-')).('`'^'!').'<'.'>'.'#'.')'.'\\'.'$'.('^'^('`'|')'))."'".'\\'.'@'.('{'^')').','.('{'^'.').('{'^'*').('{'^'#').','.('{'^'(').('`'^'%').'<'.'>'.'#'.'-'.'#'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'/')).('^'^('`'|'+')).('{'^'*').('{'^'#').','.('`'^'#').'-'.'<'.'>'.'#'.','.('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').','.('^'^('`'|'+')).('{'^'*').('{'^'#').','.('{'^'(').'='.'<'.'>'.'#'.'('.('{'^',').('^'^('`'|')'))."'".'\\'.'@'.('{'^'/').','.'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).(';'&'=').'<'.'>'.'#'.','.('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^'.').'-'.('^'^('`'|'+')).('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).'%'.'<'.'_'.'>'.'#'.('^'^('`'|'*')).('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^')').('^'^('`'|'/')).'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).'-'.'<'.'>'.'#'.')'.'\\'.'$'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').','.('{'^'/').('^'^('`'|'+')).'<'.'>'.'#'.'('.('{'^'(').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').'.'.'%'.('{'^'*').('{'^'#').'-'.('^'^('`'|'-')).('^'^('`'|'+')).'<'.'>'.'#'.'('.('{'^'#').('^'^('`'|')'))."'".'\\'.'@'.('{'^'/').','.('{'^'.').('{'^'*').('{'^'#').'-'.'\\'.'$'.('^'^('`'|'/')).'<'.'>'.'#'.('^'^('`'|'*')).('{'^'+').('^'^('`'|')'))."'".'\\'.'@'.('{'^'(').('^'^('`'|'.')).('{'^'.').('{'^'*').('{'^'#').'-'.'#'.(';'&'=').'<'.'>'.'#'.('^'^('`'|'.')).('{'^'.').')'.('^'^('`'|')'))."'".'\\'.'@'.('{'^'/').('^'^('`'|'/')).('^'^('`'|'+')).('{'^'*').('{'^'#').','.('{'^'/').('^'^('`'|'.')).('`'^'"').'\\'.'}'.('!'^'+').'"'

```

Original code was a one liner, now... it's technically still a one liner.

Try it here!

# Answer
> 1 votes
## JavaScript (ES6)

```
(s)=>/(.)(.)(.)(.)(.)(.)(.)\3[^\1]{6}\2[^\2]{5}\5[^\3]{6}\4[^\4]{5}\6[^\5]{7}\7[^\6]{10}\1[^\7]+/.test(s+atob("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXogQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo="))

```

# Answer
> 1 votes
# JavaScript ES6

My answer assumes an only-ASCII encoding. This, I am sure, is the optimal solution for JavaScript ES6 in such a setting--this is the only encoding I wish to cover. If anyone wishes to tackle non-ASCII JS, be my guest ;) This clocks in at 61 bytes, leaving me 610 bytes to obfuscate.

```
n=>n=="C\u1d0f\u0274\u1d0f\u0280 O'B\u0280\u026a\u1d07\u0274"

```

Here is my obfuscated version, clocking in 588 bytes, less than 610.

```
(c,f,d,W=this,k=e=>+(`0x`+e),C=(O,...m)=>new(O[w=`constructor`]!=C[w]?O[w]:O)(...m))=>(($,_)=>$<=_&&_<=$)([g=W[(-~(Math.sqrt((P=parseInt)(P,b=31))+P(NaN,b+=5))+0xec)[D=`toString`](b)],t=n=>(j=n=>W[n[D](b)])(n),E=W[505019[D](b)]([...[1663483,552948,1629769,516801].map(e=>e[D](b)).join``].map((s,i)=>+(42742[D](2)[i])?s.toUpperCase():s).join``),A=n=>(p,c)=>p+n+c,...[for(x of c)x.charCodeAt()]].slice(-c.length),g(`[${[...`1${[...`mn0nkjp0mio0nkjp0mkg0ji0np0jp0mm0mkg0mho0nkjh0mio`].reduce(A(-~[]))}`.match(/../g).map(e=>""[w][E](P(e,b)-4)).reduce(a)].reduce((p,c)=>c<"!"?`${p},`:p+c)}]`))

```

## Bonus material

This was my original, 947-byte obfuscation for the original challenge:

```
(c,d,f,M=Math,W=Z=this,q=($,_)=>$<=_&&_<=$,k=e=>+[`${+[+[]][+[]]}x`+e][+[]],
C=(O,...m)=>new(O[w=`constructor`]!=C[w]?O[w]:O)(...m))=>q([[d=[f=[~c]]+f],g
=W[(-~(M.sqrt(parseInt(P=parseInt,b=~-[[_=+!+[]<<-~![]][+[]]<<[_<<_/_][+[]]]
))+P(NaN,b+=5))+(e=>+[`${+[+[]][+[]]}x`+e][+[]])(C([],...C(Set,[..."abced"].
map(j=>j+i+(u+=[[u,u]],(i=j>i?j:i)?i:[]),i=u=[])[M.atan2(u[l="length"],~[]<<
~[])>>[]])).reduce(a=(p,c)=>p+c,[]+[]))|+[])[D=`toString`](b)],t=n=>(j=n=>W[
n[D](b)])(n),E=t(h=505019)([...[1663483,552948,1629769,h+=11782].map(e=>e[D]
(b)).reduce(a)].map((s,i)=>+[42742[D](2)][+[]][i]?s.toUpperCase():s).reduce(
a)),A=n=>(p,c)=>p+n+c,...[for(x of c)x[`c${E.slice(-7)}${[[]+[]][+[]][w][E](
P(42/_,_<<_<<_))+`${[]+[]}t`}`]()]].slice(-c[l]),g(`[${[...`1${[...`mn0nkjp`
+`0mio0nkjp0mkg0ji0np0jp0mm0mkg0mho0nkjh0mio`].reduce(A(-~[]))}`.match(/../g
).map(e=>[[]+[]][+[]][w][E](P(e,b)-4)).reduce(a)].reduce((p,c)=>c<"!"?`${p},
`:p+c)}]`))

```

# Answer
> 0 votes
# C++11

Golfed (129 characters including whitespaces):

```
#include<iostream>
#include<string>
int main(){std::string s;std::cin>>s;std::cout<<(s.compare("dorukayhan")==0?"true":"false");}

```

Obfuscated (much less than 1290 characters):

```
                                                             #define import using namespace
                                                                         #include<iostream>
                                                                           #include<string>
                                                                            #define def int
import std                                                                                ;

def main()                                                                                {
    string s                                                                              ;
    cin >> s                                                                              ;
    char c[] = {100, 111, 114, 117, 107, 97, 121, 104, 97, 110, 0}                        ;
    cout << (s.compare(c) == 0 ? "true" : "false")                                       ;}

```

---
Tags: code-golf, decision-problem, obfuscation
---


title: Convert ASCII box drawing into Unicode

text:
# Question
Title: Convert ASCII box drawing into Unicode
I am shamelessly posting a request for something I would actually find useful. The task is to take an arbitrary ascii box drawing like this

```
     |
+----+----+
| state A +---+
+---------+   |
              |
         +----v----+
         | state B |
         +---------+

```

... and turn it into something more beautiful using unicode box drawing characters, e.g.

```
     │
╭────┴────╮
│ state A ├───╮
╰─────────╯   │
              │
         ╭────v────╮
         │ state B │
         ╰─────────╯

```

In more detail:

* convert only + - | characters - other characters should be unchanged
* use

+ BOX DRAWINGS LIGHT VERTICAL (U+2502) │
    + BOX DRAWINGS LIGHT HORIZONTAL (U+2500) ─
    + BOX DRAWINGS LIGHT ARC DOWN AND RIGHT (U+256D) ╭
    + BOX DRAWINGS LIGHT ARC DOWN AND LEFT (U+256E) ╮
    + BOX DRAWINGS LIGHT ARC UP AND LEFT (U+256F) ╯
    + BOX DRAWINGS LIGHT ARC UP AND RIGHT (U+2570) ╰
    + BOX DRAWINGS LIGHT VERTICAL AND LEFT (U+2524) ┤
    + BOX DRAWINGS LIGHT VERTICAL AND RIGHT (U+251C) ├
    + BOX DRAWINGS LIGHT DOWN AND HORIZONTAL (U+252C) ┬
    + BOX DRAWINGS LIGHT UP AND HORIZONTAL (U+2534) ┴
    + BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL (U+253C) ┼
    + \- always replaced with U+2500
    + | always replaced with U+2502
    + \+ is replaced with a unicode character that depends on the 4 characters north, south, east and west of it (if they exist)
    + \< and \> are treated as vertical wall segments if north or south of a + (so that you can have arrows terminating in vertical walls of a box)
    + v and ^ are treated as horizontal wall segments if east or west of a + (so that you can have arrows terminating in horizontal walls of a box)
    + \+ is treated as a wall segment if either north, south, east or west of a + (so that lines can connect next to a box corner)

Testcases

```
+-+     +---+   +---+   |
| +--   |ABC|  -+   |  +++
+-+     ++--+   +---+  +-+
         |
         +--->
  |           +--+
+-v+   +---+  |  |  +-----+
|Hi|  ->   |  +^-+  |world<-----+
+--+   +---+   |    +-----+     |
               |                +--
   |
---+---
   |

```

Becomes

```
╭─╮     ╭───╮   ╭───╮   │
│ ├──   │ABC│  ─┤   │  ╭┴╮
╰─╯     ╰┬──╯   ╰───╯  ╰─╯
         │
         ╰───>
  │           ╭──╮
╭─v╮   ╭───╮  │  │  ╭─────╮
│Hi│  ─>   │  ╰^─╯  │world<─────╮
╰──╯   ╰───╯   │    ╰─────╯     │
               │                ╰──
   │
───┼───
   │

```

Shortest code wins!

# Answer
> 2 votes
## JavaScript (ES6), 236 bytes

```
s=>`
${s}
`.split`
`.map((l,i,a)=>l.replace(/[+-|]/g,(c,j)=>c>`-`?`│`:c>`+`?`─`:`┼┬├╭┤╮??┴?╰?╯`[g(a[i-1][j])+g(l[j-1],1)*2+g(l[j+1],1)*4+g(a[i+1][j])*8]),g=(c,f)=>(f?`+-^v`:`+<>|`).indexOf(c)<0).slice(1,-1).join`
`

```

---
Tags: code-golf, ascii-art, parsing, conversion, unicode
---


title: Prefix Tree Traversal

text:
# Question
Title: Prefix Tree Traversal
Write a program that takes in (via stdin or command line) a string with the recursive form

```
PREFIX[SUFFIXES]

```

where

* `PREFIX` may be any string of lowercase letters (a-z), including the empty string, and
* `SUFFIXES` may be any sequence of strings with the recursive form `PREFIX[SUFFIXES]` concatenated together, including the empty sequence.

Generate a list of lowercase lettered strings from the input by recursively evaluating the list of strings in each of the suffixes and appending them to the prefix. Output to stdout the strings in this list in any order, one per line (plus an optional trailing newline).

> ### Example
>
> If the input is
>
> ```
> cat[s[up[][]][]ch[e[r[]s[]]]a[maran[]comb[]pult[[]ing[]]]]
>
> ```
>
> then the prefix is `cat` and and the suffixes are `s[up[][]]`, `[]`, `ch[e[r[]s[]]]`, and `a[maran[]comb[]pult[[]ing[]]]`. Each suffix has its own prefix and suffixes in turn.
>
> The output would be these 9 words in any order
>
> ```
> catsup
> cats
> cat
> catcher
> catches
> catamaran
> catacomb
> catapult
> catapulting
>
> ```
>
> because the input encodes this tree
>
> and each of the 9 output words can be formed by traversing the tree from root to leaf.

### Notes

* Remember that the prefix may be the empty string, so something like

```
[donut[][]cruller[]]

```

is valid input whose output would be (in any order)

```
donut

cruller

```

where the empty line is for the empty string that the second suffix matches.
* The suffix sequence can also be empty, so the trivial input case

```
[]

```

has a single empty line as its output:

```

```
* You may assume that the input will only produce unique output words.
    + e.g. `hat[s[]ter[]s[]]` would be invalid input because `hats` is encoded twice.
    + Similarly, `[[][]]` is invalid because the empty string is encoded twice.
* You may *not* assume that the input is as short or compressed as possible.
    + e.g. the `'e'` node in the main example above could be combined with the `'ch'` node, but that's doesn't mean the input is invalid.
    + Similarly, `[[[[[]]]]]` is valid, despite only encoding the empty string in a sub-optimal way.
* Instead of a program you may write a function that takes the input string as an argument and prints the output normally or returns it as a string or list.

**The shortest code in bytes wins.**

# Answer
> 3 votes
# Ruby, ~~119~~ 115

```
t=['']
l=[0]
gets.chars{|c|c<?]?t<<''&&(l<<0)[-2]+=1:c<?^?(x=l.pop;t.pop==''&&(puts t*''if x<1;t[-1]='')):t[-1]<<c}

```

### Example

Try it: http://ideone.com/NW0CNB

### Description

The program gets the input from stdin and outputs the result to stdout.

It traverses the tree keeping the current branch in a stack. There's also a different stack, called `weights` which keeps track of the number of children of each node. This is needed in order to determine if a node is really a leaf, or it had children in the past.

The readable program:

```
stack = ['']
weights = [0]

gets.chars do |c|
  case c
  when '['
    weights[-1] += 1
    stack << ''
    weights << 0
  when ']'
    last_weight = weights.pop

    if stack.pop == ''
      puts stack.join if last_weight < 1
      stack[-1] = ''
    end
  else
    stack[-1] << c
  end
end

```

# Answer
> 6 votes
## Haskell, 125 bytes

```
t=tail.p
p=g.break(=='[')
g(a,(_:t))=(:)&(map(a++).z)$t#[]
z[]=[""];z x=x
(']':u)#a=u:a
s#a=(#)&(a++)$p s
(g&f)(x:y)=g x$f y

```

The function is `t` (for traversal):

```
λ: t "cat[s[up[][]][]ch[e[r[]s[]]]a[maran[]comb[]pult[[]ing[]]]]"
["catsup","cats","cat","catcher","catches","catamaran","catacomb","catapult","catapulting"]
λ: t "[donut[][]cruller[]]"
["donut","","cruller"]
λ: t "[[[[[]]]]]"
[""]

```

# Answer
> 2 votes
# Java, 206 bytes

Defines a function that accepts a string as an argument and returns a list of strings. For an added bonus it returns strings in the same order as the question does.

```
int c,i;List a(String a){String b=a.substring(c,c=a.indexOf(91,c));List d=new ArrayList();for(;a.charAt(++c)!=93;)d.addAll(a(a));if(d.isEmpty())d.add("");for(i=0;i<d.size();)d.set(i,b+d.get(i++));return d;}

```

### Example usage:

```
class A{
    public static void main(String[] args){
        System.out.println(new A.a("cat[s[up[][]][]ch[e[r[]s[]]]a[maran[]comb[]pult[[]ing[]]]]"));
    }

    int c,i;List a(String a){String b=a.substring(c,c=a.indexOf(91,c));List d=new ArrayList();for(;a.charAt(++c)!=93;)d.addAll(a(a));if(d.isEmpty())d.add("");for(i=0;i<d.size();)d.set(i,b+d.get(i++));return d;}
}

```

### Expanded:

```
int c, i;
List a(String a){
    String b = a.substring(c, c = a.indexOf(91, c));
    List d = new ArrayList();
    for(; a.charAt(++c) != 93 ;)
        d.addAll(a(a));
    if (d.isEmpty())
        d.add("");
    for (i = 0; i < d.size();)
        d.set(i, b + d.get(i++));
    return d;
}

```

I will add an explanation tomorrow.

# Answer
> 0 votes
# Python, 212 chars

```
def p(t,f="",o="",d=0):
 if[]==t:return
 b=[""]
 for c in t:d+=c=="[";b[-1]+=c;d-=c=="]";b+=[""]*(d==0)*(c=="]")
 for r in b[:-1]:i=r.index("[");w,s=f+r[:i],r[i:][1:-1];p(s,w);o+= ["",w+"\n"][""==s]
  if o:print o,

```

I was hoping to get under 200, but still I am pretty happy with this.

# Answer
> 0 votes
# Javascript ES6, 142 bytes

```
s=>(o=[],x=_=>s[0]==']'?s=s.slice(1):0,(g=d=>{while(s&&!x())[o[d],s]=s.split(/\[(.*)/).concat``,x()?console.log(o.join``):g(d+1),o.pop()})(0))

```

# Answer
> 0 votes
## Q: 70 Bytes

```
f:{,/'$({(z_x),y}\[();{`$x@&~x="]"}'w;-b])@-1+&0<b:(+/"]"=)'w:"["\:x}

```

defines a function f that accepts a string and return a list of strings (words)

As a lambda (anonymous function) we drop the first 2 chars f:, so length is 68 Bytes

**Test**

```
f "cat[s[up[][]][]ch[e[r[]s[]]]a[maran[]comb[]pult[[]ing[]]]]"

```

("catsup";"cats";"cat";"catcher";"catches";"catamaran";"catacomb";"catapult";"catapulting")

```
f "[donut[][]cruller[]]"

```

("donut";"";"cruller")

```
f "[[[[[]]]]]"

```

,""

**Notes**

,"" indicates a list of strings that contains only has an empty string

Symbols are atomic. Push/pop a symbol on the stack is a simple operation not affected by the lenght of the symbol (see explanation)

**Explanation**

Q is a cousin of APL (kx.com)

Pseudocode:

* Splits string (arg x) at "\[" char. Result (list of strings) in w
* Counts "\]" chars in each elem. of w. Result in b
* Modifies each item in w to filter out character "\]" and converts each string to a symbol
* Generates a logical sequence (bitmap) to mark items \>0 in b
* Iterates over partial results with a stack: if item marked we must drop one of more symbols (according to value in b). Always append actual symbol to stack
* After iterating we have all intermediate states of stack. We select previously marked states
* finally for each result we convert symbols to strings and concatenate them

# Answer
> -1 votes
# Cobra - 181

```
def f(s='')as String*
    for m in RegularExpressions.Regex.matches(s,r'(\w*)\[((?:(?<B>\[)|\w|(?<-B>]))*)](?(B)(?!))'),for r in.f('[(u=m.groups)[2]]'),yield'[u[1]]'+r
    if''==s,yield''

```

---
Tags: code-golf, data-structures, recursion
---


# Question
Title: Approximate the Fransén-Robinson constant
Given an input `n`, output the value of the Fransén-Robinson constant with `n` digits after the decimal place, with rounding.

# Rules

* You may assume that all inputs are integers between 1 and 60.
* You may not store any related values - the constant must be calculated, not recalled.
* Rounding must be done with the following criteria:
    + If the digit following the final digit is less than five, the final digit must remain the same.
    + If the digit following the final digit is greater than or equal to five, the final digit must be incremented by one.
* You must only output the first `n+1` digits.
* Standard loopholes apply.

# Test Cases

```
>>> f(0)
3

>>> f(1)
2.8

>>> f(11)
2.80777024203

>>> f(50)
2.80777024202851936522150118655777293230808592093020

>>> f(59)
2.80777024202851936522150118655777293230808592093019829122005

>>> f(60)
2.807770242028519365221501186557772932308085920930198291220055

```

# Answer
## Mathematica, ~~44~~ ~~39~~ ~~36~~ 25 UTF-8 bytes

* *-5 bytes thanks to Sp3000*
* *-3 bytes thanks to kennytm*
* *-11 bytes thanks to senegrom*

Crossed out ~~44~~ is still regular 44!!

```
N[∫1/x!{x,-1,∞},#+1]&

```

Example:

```
f=N[∫1/x!{x,-1,∞},#+1]&
f[2]

```

Outputs `2.81`.

Explanation

```
N[               , # + 1]
  ∫1/x!{x,-1,∞}

```

First step takes `N`umeric of the rest, with `#` (first parameter) + 1 precision. `!` (factorial) does what you'd expect. `{x, -1, Infinity}` sets the bounds for the (strangely formatted) Integral.
> 7 votes

---
Tags: code-golf, calculus, approximation
---


# Question
Title: Correct way to add numbers to get lots of 8's
Inspired by this question which was further inspired by this one, write a program which takes two integers and adds them in a unique way, by performing an OR operation on the segments used to display them in a 7-segment display. For reference, the digits are represented in the following way:

```
 _        _   _         _    _   _    _    _
| |   |   _|  _|  |_|  |_   |_    |  |_|  |_|
|_|   |  |_   _|    |   _|  |_|   |  |_|   _|

```

Note that the 1 uses the two segments on the right, not the left. There are two special characters that can be produced this way which are not numbers. See the addition table below:

```
  | 0 1 2 3 4 5 6 7 8 9
--+--------------------
0 | 0 0 8 8 8 8 8 0 8 8
1 | 0 1 a 3 4 9 8 7 8 9
2 | 8 a 2 a 8 8 8 a 8 8
3 | 8 3 a 3 9 9 8 3 8 9
4 | 8 4 8 9 4 9 8 Q 8 9
5 | 8 9 8 9 9 5 6 9 8 9
6 | 8 8 8 8 8 6 6 8 8 8
7 | 0 7 a 3 Q 9 8 7 8 9
8 | 8 8 8 8 8 8 8 8 8 8
9 | 8 9 8 9 9 9 8 9 8 9

```

Useful observations:

* Any digit plus itself equals itself
* 8 plus any digit equals 8
* 2 plus 1, 3, or 7 equals the letter 'a' (must be lower-case)
* 4 plus 7 equals either 'q' or 'Q', your choice
* Numbers should be right-aligned, so the digits should be added from right to left. If one number has more digits than the other, the extra digits at the beginning should be unchanged. There are no leading 0's, unless the number is exactly 0.
* All numbers will be 0 or greater. You don't need to handle a '-' sign. (Mainly because there's no good fit for the sum of a '-' and a '1' or '7'.)

Your program should accept 2 integers in any format you choose, and output a string containing their "sum" when calculated in this manner. This is code-golf, so your program should be as small as possible.

## Examples:

* Input: 12345, 123. Output: 12389
* Input: 88888, 42. Output: 88888
* Input: 0, 23. Output: 28
* Input: 120, 240. Output: a80
* Input: 270, 42. Output: 2Q8 (or 2q8)
* Input: 1234567890, 1234567890. Output: 1234567890

# Answer
> 7 votes
# Bash + Common Linux utilities, 80

```
s=~0my3[_p^?{}s
h()(tr 0-9 $s<<<$1|xxd -p)
dc -e$[0x`h $1`|0x`h $2`]P|tr $s 0-9aQ

```

Note the `^?` in the source should be replaced with an ASCII 0x7f character.

The string `s` is each 7 segment digit `0-9, a, Q` encoded with each segment corresponding to a bit of an ASCII char.

The `h()` function transliterates the input number from decimal to the encoding specified by `s`, then outputs the result as a raw hex string.

The two resulting raw hex strings are `OR`ed together using regular bash arithmetic, then output by `dc`'s `P` command as a bytestream. This bytestream is then transliterated back to decimal + a + Q and output.

Note also that when using the `<<<` bash herestring construct in function `h()` a newline is implicitly appended to the redirected string. This doesn't matter - it is simply translated to `0x0a` at the end of each hex string; when the two hex numbers are `OR`ed together, the result is still `0x0a` in the last char which doesn't get transliterated and thus simply translates back to a newline which is output after the result.

### Test output:

```
$ for testcase in \
> "12345 123" \
> "88888 42" \
> "0 23" \
> "1234 56789" \
> "4 7"; do
> ./7segadd.sh $testcase
> done
12389
88888
28
58a89
Q
$

```

# Answer
> 3 votes
# Python 2, 155 bytes

```
def f(a,b):exec"a=[ord('?(u|j^_,♥~'[int(c)])for c in a];a=max(len(b)-len(a),0)*[0]+a;a,b=b,a;"*2;print`['214567q3a980'[(c|d)%13]for c,d in zip(a,b)]`[2::5]

```

Replace the  with a `DEL` character (0x7F).

Calling `f("12345", "123")` prints `12389`.

# Answer
> 2 votes
## JavaScript (ES6), ~~158~~ 144 bytes

```
f=(s,t)=>t[s.length]?f(t,s):s[t.length]?f(s,' '+t):s.replace(/./g,(c,i)=>"540q9361278a"[(a[c]|a[t[i]])%13],a=[119,20,47,31,92,91,123,22,127,95])

```

Saved 14 bytes by shamelessly stealing @Lynn's `%13` trick.

```
f=(s,t)=>t[s.length]?f(t,s):s[t.length]?f(s,' '+t):s.replace(/./g,(c,i)=>"540q9361278a"[(a[c]|a[t[i]])%13],a=[119,20,47,31,92,91,123,22,127,95])
;o.textContent=[...s="0123456789"].map(c=>f(c.repeat(10),s)).join`
`;
```

```
<pre id=o></pre>
```

# Answer
> 1 votes
# Java, 170 bytes

This is terribly long... but this is Java anyway.

```
String A(int a,int b){String c="|HgmY=?h}oy",r="";for(;a>0|b>0;a/=10,b/=10)r="0123456789aq".charAt(c.indexOf((a>0?c.charAt(a%10):0)|(b>0?c.charAt(b%10):0)))+r;return r;}

```

## Full program, with ungolfed code

```
public class Q80716 {
    String A(int a,int b){String c="|HgmY=?h}oy",r="";for(;a>0|b>0;a/=10,b/=10)r="0123456789aq".charAt(c.indexOf((a>0?c.charAt(a%10):0)|(b>0?c.charAt(b%10):0)))+r;return r;}
    String Add(int a,int b){
        String c = "|HgmY=?h}oy", d = "0123456789aq";
        String r = "";
        for(;a>0|b>0;a/=10,b/=10){
            r = d.charAt(c.indexOf((a>0?c.charAt(a%10):0)|(b>0?c.charAt(b%10):0))) + r;
        }
        return r;
    }
    public static void main(String[]args){
        int[][] testcases = new int[][]{
            {12345,123},
            {88888,42},
            {0,23},
            {120,240},
            {270,42},
            {1234567890,1234567890}
        };
        for(int i=0;i<testcases.length;i++){
            System.out.println(new Q80716().Add(testcases[i][0],testcases[i][1]));
            System.out.println(new Q80716().A(testcases[i][0],testcases[i][1]));
        }
    }
}

```

## All output (all duplicated once)

```
12389
88888
23
a80
2q8
1234567890

```

---
Tags: code-golf, kolmogorov-complexity
---


# Question
Title: Make the lowest number square that equals n
A number square containing the values `1`, `2`, `3`, `4` looks like this:

```
12
34

```

To work out what a number square is, you first make four numbers by reading across the rows and across the columns; for the example above you would get `12`, `34`, `13` and `24`, then you add them all up (`12+34+13+24`), giving you the value of the square.

However, there is a catch: the square your program outputs must output the lowest possible square. The way to calculate how 'low' the square is is like this:

1. Take the top-left number, and place it in the variable `a`.
2. Take the top-right number, double it and add the total to `a`.
3. Take the bottom-left number, triple it and add the total to `a`.
4. Take the bottom-right number, quadruple it and add the total to `a`.
5. The variable `a` now holds how 'low' you square is!

## Requirements

* Your program must output the lowest possible number square, in the format that follows:

```
ab
cd

```

(where `a`, `b`, `c` and `d` are integers in the range `0-9`).

* The square will never contain a number multiple digits long (negative numbers as well). You don't have to handle that case.
* You can take input, which will be the number the square should equal, as an argument, as function argument or from `STDIN`. Please specify how input should be given for your program.
* If there is not a number square that equals what the input number, output nothing.
* If two numbers squares are equally low and produce the same output, nothing should be output.

## Rules

## Test Cases

```
44 ==>
04
00
-----
2 ==>
00
01
-----
100 ==>
50
00

```

@MartinBüttner has also done a Pastebin with all the possible solutions.

## Scoring

Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify.

To win this challenge, try to get the least bytes!

## Submissions

To make sure that your answer can be parsed, please start your answer with a headline, using the following Markdown template:

```
# Language Name, N bytes

```

where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:

```
# Ruby, <s>104</s> <s>101</s> 96 bytes

```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:

```
# Perl, 43 + 2 (-p flag) = 45 bytes

```

You can also make the language name a link which will then show up in the leaderboard snippet:

```
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

```

## Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

```
/* Configuration */

var QUESTION_ID = 80765; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/<a/.test(lang)) lang = jQuery(lang).text();

    languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang > b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
```

```
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
```

```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

    </tbody>
  </table>
</div>
<div id="language-list">
  <h2>Winners by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">

    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
```

# Answer
> 2 votes
# Pyth, ~~43~~ ~~41~~ 36 bytes

```
J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ

```

Test suite.

Output as 2D array. `ab/cd` is represented as `[[a, b], [c, d]]`.

## How it works

```
J.ms*VS4sbfqQsiR10sCBT^^UT2 2?tlJkhJ

                      ^^UT2 2    Generate all number-squares
                                 with the above format.

          fqQsiR10sCBT

          f          T       Filter the squares as T:
                   CB            Yield [T, transpose(T)]
                  s              Yield T union transpose(T)
                                 We generated the rows and columns
                                 of the number square.
              iR10               Convert each from base10 array to int.
             s                   Sum.
           qQ                    Check if equal to the input.

J.ms*VS4sb

 .m      b         Find the squares (as b) in the filtered-result,
                   in which the following attains minimum:

        s              Flatten.
    *VS4               Multiply the first number by 1,
                               the second number by 2,
                                the third number by 3,
                           and the fourth number by 4.
   s                   Sum.
J                  Assign to the variable J.

                             ?tlJkhJ

                             ?         if
                              tlJ         length of J is not 1:
                                 k          output empty string
                                  hJ   else: output the first element of J

```

# Answer
> 1 votes
# Pyth, 69 bytes

```
J.x.mebm,ds.e*hksbdfqQssM[<2T>2T+hTePT+htTeT)m.[\04`dU10000k?qlJ1hhJk

```

Try it here!

Outputs the square as a 4-digit number.
Works by generating all possible squares, keeping the ones which have the given number and then getting the lowest one.

Detailed Explanation later, gonna try to find a shorter way to calculate the number of a square first.

# Answer
> 1 votes
## Matlab(284)

Too much rules, too much bytes, i hate too much rules!

```
function h(n),f=mod(n,2);b=(n-11*f)/2;a=fix((n-2*b)/11);c=(mod(ceil(b/11),10)+1)*(b>99);b=b-c*11;a=a+2*c;u=min(fix(b/10),mod(b,10));r=min(u,fix((9-a)/2*(a<9)));a=a+2*r;b=b-11*r;if(a>18||b<0||a+2*(u-r)>9&a==8)return;end,u=(a>9);r=mod(a,10-u);[fix(b/10),max(u*9,r);min(u*9,r),mod(b,10)]

```
* this is a straight-forward method without even calculating the lowest weight of a square, i will add an explanation once i online-fork it.

This is how it goes, as known that a square value `ab+cd+ac+bd` can be simplified algebrically as `11(b+c)+2*[ad]_dec` where \[ad\] is `a*10+d` , with weights assigned by ops respectively as `(W_a,W_d)=(1,4)` and `(W_b,W_c)=(2,3)` .

Thus, assuming an initial value of \[ad\] set as maximal number written in two digits, any number subtracted from it must be a multiple of 11 to be added to (b+c), otherwise that would screw the general form that the square value must be written as.

Since \[ad\] is two digits number, the multiple of 11 subtracted from \[ad\] must hold same amount from both a and d, which means weights are decreased equally but not added to `(b+c)` equally because it is required to attribute the maximal number to the lowest upweighting number which is `b`. so b will receive an even number. See the picture below it is definitely clearer than my awkward wording:

See that a (ported) value is not addded gradually, but there is a mathematical condition for it , it is `S=minimum_positive(9-(b+c),a,d)`

For the rest of conditions, function doesnt output nothing when:

* `b+c` exceeds 18
* the square value is below 11 and odd
* after adding the farce to (b+c), min(a,d) remains bigger than 1, and b+c = 8, this means there is a potential square value of weight 3+2 , which equals the weight 1+4 , two equivalent values is an exclusive option, and disqualifies the outputs (tbh i dont see any point behind this rule)

# Answer
> 0 votes
# C (ANSI), 210 bytes

```
#define a (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10)
main(g,o,l,f){g--;o=91;for(f=l=-1;l<10000;g==++l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/    10%10)?a==o?f=-1:a<o?f=l,o=a:1:1);printf("%04i",f);}

```

Pretty much makes all possible squares and finds the lowest. Input is read in as number of arguments. Output is the square as a 4 digit number.

### Ex: 8

```
./numberSquare 1 1 1 1 1 1 1 1
0004

```

### Expanded Version:

```
calcScore(l){
    return (l/1000)+2*((l/100)%10)+3*((l%100)/10)+4*(l%10);
}

main(g,o,l,f){
    g-=2;
    o=91;
    for(f=l=-1;l<10000;l++){
        if(g==l%100+l/100+(l%10)+((l/100)%10*10)+((l/1000)*10)+(l/10%10))
            if(calcScore(l)==o)f=-1;
        else if(calcScore(l)<o)f=l,o=calcScore(l);
    }
    printf("%04i",f);
}

```

# Answer
> 0 votes
## Haskell, 133 bytes

```
a#b=10*a+b
g n|l<-[(a+2*b+3*c+4*d,m)|m@[a,b,c,d]<-mapM id$[0..9]<$"aaaa",a#b+a#c+b#d+c#d==n]=[b|q@(a,b)<-l,all(\k@(j,_)->j>a||k==q)l]

```

Output is a four element list `[a,b,c,d]`. Usage example: `map g [129..139]` -\> `[[[1,9,0,5]],[],[[6,1,0,0]],[],[[5,3,0,0]],[],[[4,5,0,0]],[],[[3,7,0,0]],[],[[2,9,0,0]]]`.

How it works:

```
l<-[        ]                  -- let l be the list of all
  (a+2*b+3*c+4*d,m)|           -- pairs (score, matrix), where
     m@[a,b,c,d]<-             -- matrix m (= [a,b,c,d]) is drawn from
       mapM id$[0..9]<$"aaaa", -- all permutations of the digits of length 4 and
       a#b+a#c+b#d+c#d==n      -- the matrix sum equals n

=[b|            ]              -- return a list of all matrices b, where
  q@(a,b)<-l                   -- the pair q = (a,b) is drawn from l and
    all(\k@(j,_)->j>a||k==q)l] -- a is minimal and unique

```

---
Tags: code-golf, math, number
---


# Question
Title: Generate an infinite group of infinite galaxies
Here is the challenge as proposed by @trichoplax thanks to him for consolidating my post and standarizing it to PPCG common-rules.

---

* A **galaxy** is a group of numbers where each one is mapped to another via a precise function **f** either a symbolic one or mathematical, a structure of numbers sharing some common points with this challenge i got inspired from with an exception that a galaxy sequence is not cyclic, but holds in a **black hole**, where **more than one number** can be mapped to it.
* A black hole is a specific unique number from a galaxy where all numbers (not individually) are mapped transitively to it, by repeating a function **f** infinitely over an infinite far number in a same galaxy, or just once if a number is the closest in the same galaxy, for example if the function is the ceiling of the square root then a black hole for the biggest galaxy so far excluding only the number 1 is `2`, because mapping the closest number `3` or the infinite repetitively leads to the same number.

# Task

Conceive a universe of an **infinite** number of distinct galaxies where all galaxies encompass an **infinite** number of **integers**.

Note that the example of ceiling of square root is banned for two reasons:

* The galaxy {1} is finite.
* There is a finite number of galaxies.

A valid example, is dividing by the smallest prime factor. This gives an infinite number of infinite galaxies.

```
2*2*3*5*5*7, 2*3*5*5*7, 3*5*5*7, 5*5*7, 5*7, 7, 7*5*5*5, 7*5*5*5....
5*5*7*11, 5*7*11, 11*7*7*7... , ....
...

```

Or one galaxy as a tree:

```
2*2*5 - 2*5 \
             \
2*3*5 - 3*5 - 5
3*3*5 /       |
             /
2*5*5 - 5*5 /
3*5*5 /

```

Each galaxy consists of all numbers that share the same largest prime factor, and the function takes them all step by step towards the black hole which is that prime factor.

Note also, you may choose any domain of integers as long as the range is infinite, i mean you can exclude a range of numbers that makes the rest still boundless like {1,0} from last example.

Your program takes any integer input via a function's dimension , STDIN, and outputs an integer as the image mapped from this preimage, otherwise prints "error" or any string prespecified for an outputless range of enteries.

For the same example:

(IN/OUTPUT)

```
   20
   10

   15
   5

   77
   11

   0
   'undefined'

   1
   'undefined'

```

This is so shortest program in bytes wins.

I would have really liked to add a bonus-score for anyone who succeeds to find a function generating a universe without trees, alas, bonuses for code-golf are excluded.

# Answer
> 2 votes
# Pyth, ~~5~~ 4 bytes, no trees

I am working under the assumption that the author intended for the function to be surjective, and for “no trees” to mean that only black holes have multiple preimages. (Technically, a tree with only one branch is still a tree.)

```
ahxt

```

Domain: positive integers. Function: *f*(*x*) = |((*x* − 1) XOR *x*) + 1 − *x*|. Black holes: powers of 2. Galaxies:

1 ← 3 ← 5 ← 7 ← 9 ← 11 ← ⋯,
2 ← 6 ← 10 ← 14 ← 18 ← 22 ← ⋯,
4 ← 12 ← 20 ← 28 ← 36 ← 44 ← ⋯,
8 ← 24 ← 40 ← 56 ← 72 ← 88 ← ⋯,

# Answer
> 5 votes
# Python 2, 15 bytes

```
lambda n:n>>n%2

```

The domain is nonnegative integers.

# Answer
> 3 votes
# Python, 40 bytes

```
lambda n:n&~-n and int(bin(n)[3:],2)or n

```

Clear the top bit if there's more than one bit set, otherwise returns the number itself. The domain is the positive integers.

First couple numbers (in binary):

```
    1:     1
   10:    10
   11:     1
  100:   100
  101:     1
  110:    10
  111:    11
 1000:  1000
 1001:     1
 1010:    10
 1011:    11
 1100:   100
 1101:   101
 1110:   110
 1111:   111
10000: 10000
10001:     1
10010:    10
10011:    11
10100:   100
10101:   101
10110:   110
10111:   111
11000:  1000
11001:  1001
11010:  1010
11011:  1011
11100:  1100
11101:  1101
11110:  1110
11111:  1111

```

# Answer
> 3 votes
# Pyth, 2 bytes

```
hP

```

Domain: integers ≥ 2. Function: smallest prime factor. Black holes: primes.

(This seems too simple but seems to satisfy the challenge as far as I can tell. Is the challenge missing some requirement? For example, perhaps the function is supposed to be surjective?)

# Answer
> 2 votes
## 05AB1E, 9 bytes

**Code:**

```
Dpiëf¬¹s/

```

**Explanation:**

```
Dpi         # if input is prime return input
   ë        # else
    f¬      # get the smallest primefactor
      ¹s/   # divide input by this factor

```

Domain:`{n | n∈N ∧ n>1}`

Range: `{n | n∈N ∧ n>0}`

# Answer
> 2 votes
# Python 2, 29 bytes

```
lambda n:int("0"+`n`[1:])or n

```

Strips off the first digit, unless that makes the number 0. The domain is the positive integers.

# Answer
> 2 votes
## JavaScript (ES6), 12 bytes

```
n=>n%2?n:n/2

```

The domain is the positive integers. The black holes are the odd numbers.

# Answer
> 1 votes
# Pyth, 5 bytes

```
|stzz

```

Port of my Python answer (the decimal version).

# Answer
> 0 votes
## matlab (156)

```
a=input('');if find(num2str(a)=='0')a,return,end,b=char(num2str(a)-1);c=str2num(b);if find(b=='0')if(find(num2str(c)=='0')&c)c,else 10^nnz(b)+c,end,else c,end

```
* I declare my self the winner of that imaginary score because i am the first who finds a universe of galaxies without trees.
* Domain is decimal numbers with two or more significant digits. and not a difference bteween two arbitray digits squals to 9 .
* Black holes are numbers which have significant zeros, either in the extreme bottom, or between two strictly positive digits `12300131` , `123400` , `10` , ....
* The function is decrementing all decimal digits of that number by `1`, if we stumble upon a significant zero we declare a blackhole, if non-significant zero at the head of this number, precede it with `1` then the result topped by unsignificant zeos.
* There is no trees in that galaxy except the blackhole which absorbs an infinite tree-less streams of finite numbers.

---
Tags: code-golf, number-theory
---


title: The game of Sevens! Who said what?

text:
# Question
Title: The game of Sevens! Who said what?
The game of Sevens is played as follows: `n` players sit in a circle, and start counting up from 1, passing to the left (or from player `A` to player `B`).

When a number `p` that has a `7` in it OR is divisible by `7` is reached, then the player who spoke the number `p-1`, after the next player says `p`, must say `p+1` and the order of people speaking reverses. For example, if player `B` speaks `6`, player `C` says `7`, `B` says `8`, and player `A` says `9`.

**Note:** For those who want to play in real life, if a person forgets a number (or in the version where `sevens` are not said, accidentally says a `seven`), they are eliminated from the circle, but we will omit this detail from this challenge.

The challenge itself is to print which numbers each player should say in a perfect game of Sevens up to an input `m` for an input `n` players.

As an example, where five people, `A`, `B`, `C`, `D`, and `E`, are to play till they reach `30`. They play in this manner

```
A: 1 6 8 13    15 19       23    30
B: 2 7*  12    16 18       24
C: 3     11    17*         25
D: 4     10          21*   26 28*
E: 5      9 14*      20 22 27*29

```

where `sevens` are marked with `*`. Note that at `27` and `28`, we're reversing twice, and play continues "as normal" from `D` to `E`.

Please note that the output does not have to be in the above format. I simply printed it that way for some clarity.

**Rules**

* The input is two integers in any order, `m` representing the last number to say, `n` representing the number of players.
* The output can be several arrays or several strings, one for each player. If you use strings, you do not have to use separators (though, if you could add some in your code tests, we would appreciate the readability). If you can actually print them in a circle somehow, that is acceptable as well, and it would be pretty cool too.
* The output does not have to designate which players are which (it's fairly obvious that the first player is the one who says `1`), though if the output isn't sorted for whatever reason, you should make clear which player is speaking which set of numbers. Omitting players who do not say anything is also allowed if you make it clear which players are speaking. I will add some more examples of possible outputs below.
* This is code golf, so the smallest number of bytes wins.

As always, if the problem is unclear, please let me know. Good luck and good golfing!

**Examples**

```
>>> sevens_string(30, 5, " ")
'1 6 8 13 15 19 23 30'
'2 7 12 16 18 24'
'3 11 17 25'
'4 10 21 26 28'
'5 9 14 20 22 27 29'
>>> sevens_string(42, 5)
'16813151923303539'
'27121618243140'
'31117253241'
'410212628333742'
'591420222729343638'
>>> sevens_array(20, 3)
[1, 4, 7, 10, 13, 15, 19]
[2, 5, 9, 12, 16, 18]
[3, 6, 8, 11, 14, 17, 20]
>>> sevens_array(18, 10)
[1, 13, 15]
[2, 12, 16, 18]
[3, 11, 17]
[4, 10]
[5, 9]
[6, 8]
[7]
[]
[]
[14]

```

# Answer
# Pyth, 38 bytes

```
Jm[)EA,01VQa@JZ=hG=+Z=W|}\7`G!%G7H_H;J

```

Try it online. Test suite.

Basically a port of my Python answer; there's probably a better way. Takes as input the number to count up to `n` and the number of players `p` on separate lines, outputs the result as a two-dimensional array.
> 2 votes

# Answer
# Haskell, 151 bytes

```
s n|elem '7'(show n)||mod n 7==0=(0-)|0<1=id
a=scanl1(+)$map($1)$scanl(.)id$map s[1..]
f m n=mapM_ print[[x+1|x<-[0..m-1],mod(a!!x-1)n==i]|i<-[0..n-1]]

```

```
*Main> f 30 5
[1,6,8,13,15,19,23,30]
[2,7,12,16,18,24]
[3,11,17,25]
[4,10,21,26,28]
[5,9,14,20,22,27,29]

```
> 3 votes

# Answer
# Python 3, 155 bytes

```
from turtle import*
def f(m,n,i=0,r=20,d=360):
 k=n
 while i<m:i+=1;fd(r);write(i);bk(r);e='7'[:i%7]in str(i);d*=1-2*e;k=~-e*(1-k)%n;r+=(k<1)*15;rt(d/n)

```

Uses turtle graphics to print in a circle such that numbers spoken by the same player are on the same radius. The radius of the circle is increased when the direction is reversed, or when the sequence wraps around the circle, so previous numbers aren't overwritten.

Sample output for `f(22,6)`
> 2 votes

# Answer
# Python 2, ~~103~~ ~~102~~ 101 bytes

```
def S(n,p):
 P=0;D=N=1;O=['']*p
 while n:O[P%p]+=`N`;D*=1-2*(N%7<1or'7'in`N`);N+=1;P+=D;n-=1
 print O

```

Defines a function `S(n,p)` that takes the number to count to `n` and the number of players `p` and prints the result as an array of strings.

```
>>> S(42,5)
['16813151923303539', '27121618243140', '31117253241', '410212628333742','591420222729343638']

```
> 1 votes

# Answer
# Python 2, ~~91~~ ~~90~~ 87 bytes

```
def f(m,n):a=d=i=0;r=[()]*n;exec"i+=1;r[a%n]+=i,;d^='7'[:i%7]in`i`;a+=1-2*d;"*m;print r

```

Prints a list of tuples. Test it on Ideone.
> 1 votes

# Answer
# Jelly, ~~27~~ 25 bytes

```
D;Æf7e
R’Ç€^\ḤC+\_'R}⁹ḍT€

```

Try it online! or verify all test cases.
> 1 votes

# Answer
# Dyalog APL, ~~50~~ ~~47~~ 35 bytes

```
{,⌸⍵|+\0,¯1*+\{0=7|⍵×~7∊⍎¨⍕⍵}¨⍳⍺-1}

```

This displays the numbers each player said as a table, where the first column enumerates the players. Rows are padded with **0**s to the same length, and rows without numbers are omitted.

### Verification

```
      f ← {,⌸⍵|+\0,¯1*+\{0=7|⍵×~7∊⍎¨⍕⍵}¨⍳⍺-1}
      30 f 5
0 1  6  8 13 15 19 23 30
1 2  7 12 16 18 24  0  0
2 3 11 17 25  0  0  0  0
3 4 10 21 26 28  0  0  0
4 5  9 14 20 22 27 29  0
      42 f 5
0 1  6  8 13 15 19 23 30 35 39
1 2  7 12 16 18 24 31 40  0  0
2 3 11 17 25 32 41  0  0  0  0
3 4 10 21 26 28 33 37 42  0  0
4 5  9 14 20 22 27 29 34 36 38
      20 f 3
0 1 4 7 10 13 15 19
1 2 5 9 12 16 18  0
2 3 6 8 11 14 17 20
      14 f 10
0  1 13
1  2 12
2  3 11
3  4 10
4  5  9
5  6  8
6  7  0
9 14  0

```

Note that, in the last example, **7** and **8** are omitted since those players haven't said anything yet.
> 1 votes

# Answer
## Ruby, 81

```
->n,m{g=[""]*n
k=j=0
i=1
m.times{g[j%n]+=w="#{k+=1}"
j+=i=k%7<1||w[/7/]?-i :i}
g}

```

Pretty straightforward implementation. Returns an ugly glommed string (you can add a space to make it `"#{k+=1} "` for... well, a spaced string). I wonder if there's a more mathematical algorithm out there.
> 1 votes

# Answer
# Factor 172

I managed to do it longer than Haskell, and as readable as APL! Do I get a cookie?

```
[| l! n! | 1 0 0 :> ( p! x! z! ) n iota [ 1vector ] map <circular> n! l iota [ 1 + z! z 7 mod 0 = 55 z 10 >base in? or -1 and 1 or p * p! z x n nth push x p + x! ] each n ]

```

It's a quotation (anonymous function) that outputs a circular sequence of vectors. Each vector starts with the number of player, and then the numbers that correspond to that player.

```
30 5 [| l! n! | 1 0 0 :> ( p! x! z! ) n iota [ 1vector ] map <circular> n! l iota [ 1 + z! z 7 mod 0 = 55 z 10 >base in? or -1 and 1 or p * p! z x n nth push x p + x! ] each n ] call

Outputs:
T{ circular
    { seq
        {
            V{ 0 1 6 8 13 15 19 23 30 }
            V{ 1 2 7 12 16 18 24 }
            V{ 2 3 11 17 25 }
            V{ 3 4 10 21 26 28 }
            V{ 4 5 9 14 20 22 27 29 }
        }      ^ Note: first val is player number starting at 0
    }
}

```

I started with this:

```
: game-of-7 ( last-num num-players -- {players:={numbers}} )
  1 1 set ! increment
  0 2 set ! current-index
  iota [ drop V{ } clone ] map <circular>
  swap iota
  [ 1 + ! iotas go 0 to n-1
    dup [ 7 mod 0 = ] [ 10 >base 55 swap in? ] bi or
    [ 1 get -1 * 1 set ] when
    over 2 get swap nth push
    2 get 1 get + 2 set
  ] each ;

```

which is not good factor code, but a lot more clear (yes, I'm using numbers as variable names there, don't look at me like that!).
> 1 votes

# Answer
# JavaScript (ES6) 100

Returning result as a string array, no separators

```
(m,n)=>(d=>{for(r=[],p=i=0;i++<m;d=i%7&&!~(i+'').search(7)?d:n-d,p=(p+d)%n)r[p]=(r[p]||'')+i})(1)||r

```

Or more readable, for 3 bytes more, returning result as an array of arrays

```
(m,n)=>(d=>{for(r=[],p=i=0;i++<m;d=i%7&&!~(i+'').search(7)?d:n-d,p=(p+d)%n)r[p]=[...r[p]||[],i]})(1)||r

```

**Test** Using the new wonderful console feature of the Stack Snippets

```
S=(m,n)=>(d=>{for(r=[],p=i=0;i++<m;d=i%7&&!~(i+'').search(7)?d:n-d,p=(p+d)%n)r[p]=(r[p]||'')+i})(1)||r

A=(m,n)=>(d=>{for(r=[],p=i=0;i++<m;d=i%7&&!~(i+'').search(7)?d:n-d,p=(p+d)%n)r[p]=[...r[p]||[],i]})(1)||r

console.log(S(42,5))
console.log(A(20,3))
```
> 0 votes

# Answer
# J, ~~63~~ ~~60~~ ~~59~~ ~~58~~ 56 bytes

```
4 :'>:@I.(i.y)=/y|+/\0,_1^+/\(7 e."1 q:,.10#.inv])}.i.x'

```

### Verification

```
   f =: 4 :'>:@I.(i.y)=/y|+/\0,_1^+/\(7 e."1 q:,.10#.inv])}.i.x'
   30 f 5
1  6  8 13 15 19 23 30
2  7 12 16 18 24  0  0
3 11 17 25  0  0  0  0
4 10 21 26 28  0  0  0
5  9 14 20 22 27 29  0
   42 f 5
1  6  8 13 15 19 23 30 35 39
2  7 12 16 18 24 31 40  0  0
3 11 17 25 32 41  0  0  0  0
4 10 21 26 28 33 37 42  0  0
5  9 14 20 22 27 29 34 36 38
   20 f 3
1 4 7 10 13 15 19
2 5 9 12 16 18  0
3 6 8 11 14 17 20
   14 f 10
 1 13
 2 12
 3 11
 4 10
 5  9
 6  8
 7  0
 0  0
 0  0
14  0

```
> 0 votes

---
Tags: code-golf, game, counting
---


title: Is the gas lighter than air?

text:
# Question
Title: Is the gas lighter than air?
Air balloons need a gas that is lighter than air. However, hydrogen is flammable, while helium is not sustainable, so we need a replacement! You must write code that determines whether any given gas is lighter than air.

---

Input: a molecular chemical formula of a gas (ASCII)

Output: `true` if the gas is lighter than air; `false` otherwise (see here for consensus on what can be used as `true` and `false`).

If the chemical formula doesn't represent a gas (at standard conditions), or if it's a nonsense, any behavior is acceptable.

That is to say, you can assume the following:

* The input is a valid chemical formula
* The input is a molecular chemical formula: all element symbols are mentioned only once, and there are no parentheses
* The chemical substance exists at normal conditions
* The chemical substance is a gas at normal conditions

As a special case, `H2O` (water vapor) is considered a gas, because you can mix a significant quantity of it with air at standard conditions.

---

Whether or not a gas is lighter than air can be determined by calculating its molar mass:

Extract the chemical element symbols from the formula. Their atomic masses are given by the following table:

* H - 1
* He - 4
* B - 11
* C - 12
* N - 14
* O - 16
* F - 19
* Ne - 20
* Others - greater values

Calculate the molar mass, which is the sum of all the atomic masses. If the molar mass is less than 29, the gas is lighter than air.

---

Test cases:

```
H2      true
He      true
B2H6    true
CH4     true
C2H2    true
C2H4    true
HCN     true
N2      true
NH3     true
H2O     true
CO      true
HF      true
Ne      true
O2      false
C2H6    false
C4H10   false
H2S     false
COH2    false
CO2     false
SiH4    false
NO      false
BN      behavior nor specified: not a gas
HBO2    behavior nor specified: not a gas
F2O     behavior nor specified: incorrect formula
CH3     behavior nor specified: incorrect formula
HCOOH   behavior nor specified: not a molecular formula
B(OH)3  behavior nor specified: not a molecular formula
XYZ     behavior nor specified: nonsense

```

(Note: this is meant to be an enumeration of **all** possible inputs that generate `true`. If I forgot some, I'll add it. In any case, Wikipedia is the answer for questions like "Does substance X exist?", "Is it a gas?")

---

A related (but different) question: calculate the molar mass

# Answer
# Perl 5, 52 bytes

51 plus 1 for `-p`:

```
$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O?|e)|N2|NH3|Ne|CO)$/

```

or

```
$_=/^(B2H6|C2H2|C2?H4|H(CN|F|2O)|[HN][e2]|NH3|CO)$/

```

or any of a few similar scripts.

Based (obviously) on MattPutnam's Clojure answer.
> 1 votes

# Answer
# Retina, ~~108~~ 104 bytes

```
[A-Z]
;$&
Ne
xF
F
xxxO
O
xxN
N
xxC
C
xB
B
11$*x
e
xxx
H
x
x(?=x*(\d+))
$1$*x
[A-Z]
30$*x
[^x]

M`x{29}
0

```

Try it online!

Test suite.
> 1 votes

# Answer
## JavaScript (ES6), 119 bytes

```
s=>s.replace(/([A-Z][a-z]?)(\d*)/g,(_,a,n)=>m+=[11,12,19,1,4,14,20,16]["B C F H HeN NeO".search(a)/2]*(n||1),m=0)&&m<29

```

Any unknown atom causes the result to compute to `NaN` which is not less than 29.
> 1 votes

# Answer
# Clojure, 69 bytes

```
#(#{"H2""He""B2H6""CH4""C2H2""C2H4""HCN""N2""NH3""H2O""CO""HF""Ne"}%)

```

If that's the full list of truthy answers...
> 1 votes

# Answer
# Python, 235 Bytes

```
import re
a={"H":1,"He":4,"B":11,"C":12,"N":14,"O":16,"F":19,"Ne":20}
try:print(str(29>sum([int(p[1])*a[p[0]] for p in [c if c[1]!="" else (c[0],"1") for c in re.findall(r'([A-Z][a-z]*)(\d*)',input())]])).lower())
except:print("false")

```

Explanation:

```
import re # For the Regex
a={...} # Defining masses
try... except: # Catches unexpected elements and return false
re.findall(r'([A-Z][a-z]*)(\d*)',input()) # Group capture of the elements (credit to Draxx)
c if c[1]!="" else (c[0],"1") for c in # Sometimes, they may not have numbers after them, thus, if else!
int(p[1])*a[p[0]] # Mass of each elements
str(29>sum(...)).lower() # Boolean whether the statement is true/false translated to lower case string

```

Or, taking the MattPutnam way of doing things...

# Python, 71 Bytes

```
lambda n:n in"H2 He B2H6 CH4 C2H2 C2H4 HCN N2 NH3 H2O CO HF Ne".split()

```

(Credit to @Lynn)
> 0 votes

---
Tags: code-golf, parsing, chemistry
---