arsenide 6 years ago

Console program to auto solve:

  String.prototype.replaceAll = function(search, replacement) 
  {
      var target = this;
      return target.replace(new RegExp(search, 'g'), replacement);
  };

  function sleep (time) {
    return new Promise((resolve) => setTimeout(resolve, 
  time));
  }

  for (var i=0;i<100;i++) { sleep(i*2000).then(() => {
    if 
  (eval(document.getElementById("opt1").innerText.replaceAll("×", "*").replaceAll("÷", "/").replaceAll("−", "-")) > eval(document.getElementById("opt2").innerText.replaceAll("×", "*").replaceAll("÷", "/").replaceAll("−", "-")))
  {
      document.getElementById("opt1").click()
  } else {
	  document.getElementById("opt2").click()
  }
  })}
et15 6 years ago

I found myself developing various rules in my head with negatives versus division, etc. to solve these quicker without having to do most of the math. Interesting game, thanks for sharing!

  • alexeldeib 6 years ago

    I did exactly the same, and got fairly high accuracy. Funny how we can use heuristics with a relatively high success rate more quickly than doing the math.