Post History
J, 39 char Solution: (a.{~ a.((6|.8{.1)+.(_8&{.))&.#:"0@i.]) Test example: (a.{~ a.((6|.8{.1)+.(_8&{.))&.#:"0@i.]) '([({Enclosed})])A@B.c' ({({enclosed})})a`b.c How it ...
Answer
#1: Initial revision
# J, 39 char **Solution:** ``` (a.{~ a.((6|.8{.1)+.(_8&{.))&.#:"0@i.]) ``` **Test example:** ``` (a.{~ a.((6|.8{.1)+.(_8&{.))&.#:"0@i.]) '([({Enclosed})])A@B.c' ({({enclosed})})a`b.c ``` **How it works:** ``` 6|.8{.1 creates binary 0 0 1 0 0 0 0 0 _8&{. ensures that binari from ascii is 8 bit (6|.8{.1)+.(_8&{.) makes third bit 1 a.((6|.8{.1)+.(_8&{.))&.#:"0@i. searches for text on right in character vector a.,... ...then converts to binary, then ensures third bit is 1, then, using &. reverses the binary a.{~ converts the reversed binary, which is an ascii number, back to character text ```