This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this[(![]+[])[-~[]]+(![]+[])[-~-~[]]+(!![]+[])[-~-~-~[]]+(!![]+[])[-~[]]+(!![]+[])[ | |
| +[]]]((![]+[])[+[]]+(![]+[])[-~[]]+(!![]+[])[-~[]]+(!![]+[])[+[]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function map (arr, func) { | |
| var ret = new Array(len), | |
| len = arr.length; | |
| while (len--) | |
| ret[len] = func(arr[len]); | |
| return ret; | |
| } | |
| function divide (str, len) { | |
| return str.match(new RegExp('.{1,' + len + '}', 'g')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var board = [ | |
| [ 'a', 'b', 'c', 'd' ], | |
| [ 'a', 'f', 's', 'j' ], | |
| [ 'd', 'e', 'a', 't' ], | |
| [ 'g', 'u', 'n', 'f' ] | |
| ]; | |
| var dictionary = [ 'fab', 'fad', 'san', 'fan', 'fade', 'fed', 'seat', 'dab', 'bad' ]; | |
| var Solver = function ( board, dictionary ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convertToBase (number, base) { | |
| var currentNumber = Math.floor(number / base), | |
| remainder = number % base, | |
| rightChar = '0123456789ABCDEF'.charAt(remainder), | |
| leftStr = (currentNumber ? convertToBase(currentNumber, base) : ''); | |
| return leftStr + rightChar; | |
| } | |
| function convertFromBase (str, base) { | |
| var rightChar = str.substr(-1), |