Searinox

Untitled

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