Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _solve () {
- _sh.sendKeys(['1B5B41','1B5B43','1B5B42','1B5B44'][JS_MinimaxBestMove(
- [...document.querySelectorAll("#console > div:not(.scrollback) > span")]
- .map((e) => e.innerText.trim())
- .filter((e) => ~e.indexOf("|"))
- .reverse().slice(1, 12).reverse()
- .filter((e, i) => ~[1,4,7,10].indexOf(i))
- .map((e) => e.slice(1,-1 ).split("|").map((e) => +e.trim()))
- .reduce((acc, val, idx, arr) => {
- val.map((e, i) => (e>0 ? acc[i][idx] = new Tile({x: i, y: idx}, e) : null))
- return acc
- }, [[null,null,null,null], [null,null,null,null], [null,null,null,null], [null,null,null,null]]))])
- }
- function _handler () {
- _solve()
- top._timer = setTimeout(_handler, Math.floor(Math.random() * 666) + 333)
- }
- function _stop () { clearTimeout(top._timer); }
Add Comment
Please, Sign In to add comment