|
const yokogaki = '594853742659063875790548285856498764696464839' |
|
const tategaki = yokogaki.match(/.{9}/g).reduce((state, el) => { |
|
el.split('').forEach((e, i) => { |
|
state[9 - i] = (state[9 - i] || '') + e |
|
}) |
|
return state |
|
}, []).join('') |
|
|
|
const noFilter = () => true |
|
const isPrime = e => [2, 3, 5, 7].includes(+e) |
|
const isNotPrime = e => !isPrime(e) |
|
const isEven = e => [0, 2, 4, 6, 8].includes(+e) |
|
const isOdd = e => [1, 3, 5, 7, 9].includes(+e) |
|
|
|
const parseNone = e => e.split('').map(e => +e) |
|
const createParser = (order, size, delta = 0) => e => { |
|
const map = Array.from(new Set(e.split(''))).sort() |
|
|
|
if (map.length > order || e.length % size !== 0) return [] |
|
|
|
return e |
|
.replace(/./g, e => (map.indexOf(e) + delta) % order) |
|
.match(new RegExp('.{' + size + '}', 'g')) |
|
.map(e => parseInt(e, order)) |
|
} |
|
const limitParser = max => e => { |
|
return e.split('').reduce((state, element) => { |
|
const last = state[state.length - 1] |
|
|
|
if (!last || Number(last + element) > max) { |
|
state.push(element) |
|
} else { |
|
state[state.length - 1] += element |
|
} |
|
|
|
return state |
|
}, []).map(e => +e) |
|
} |
|
|
|
const alphabetLower = 'abcdefghijklmnopqrstuvwxyz' |
|
const alphabetUpper = alphabetLower.toUpperCase() |
|
const alphabet = alphabetLower + alphabetUpper |
|
|
|
const formatNone = e => e |
|
const formatLower = e => alphabetLower.charAt(e) |
|
const formatLetter = e => alphabet.charAt(e) |
|
const formatAlpha = e => e.toString(36) |
|
const formatAlphaInverse = e => alphabet.charAt(e) || (e - 26 * 2) |
|
const formatAscii = e => String.fromCharCode(e) |
|
const formatHex = e => e.toString(16) |
|
|
|
const found = new Set() |
|
|
|
;[yokogaki, tategaki].forEach(e => { |
|
;[noFilter, isPrime, isNotPrime, isEven, isOdd].forEach(filter => { |
|
const filtered = e.split('').filter(filter).join('') |
|
;[ |
|
parseNone, |
|
limitParser(16), limitParser(32), limitParser(64), limitParser(128), limitParser(256), |
|
createParser(4, 2), createParser(4, 3), createParser(4, 3, 2), createParser(4, 3, 2), |
|
createParser(8, 2), createParser(8, 3), |
|
createParser(8, 2), createParser(8, 2, 2), createParser(8, 2, 4), createParser(8, 2, 6), |
|
createParser(8, 3), createParser(8, 3, 2), createParser(8, 3, 4), createParser(8, 3, 6) |
|
].forEach(parse => { |
|
const parsed = parse(filtered) |
|
;[formatLower, formatLetter, formatAlpha, formatAlphaInverse, formatAscii].forEach(format => { |
|
const formatted = parsed.map(format).join('') |
|
|
|
if (formatted) { |
|
found.add(formatted) |
|
} |
|
}) |
|
}) |
|
}) |
|
}) |
|
|
|
console.log(Array.from(found).sort().join('\n')) |
The strange thing is that this sequence changes in other seasons, like here: https://i.stack.imgur.com/IvrQU.png
If I (or someone else) rewatch this anime I will take more screenshots.