Created
October 4, 2016 10:35
-
-
Save naffiq/878f8cad5701ce81d555f6878f5d989b to your computer and use it in GitHub Desktop.
Telegram Math battle win code
This file contains 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 answer = function() | |
{ | |
var calc = function(x, y, op) { | |
x = parseFloat(x); y = parseFloat(y); | |
if (op == '+') return x + y; | |
if (op == '–') return x - y; | |
if (op == '×') return x * y; | |
if (op == '/') return x / y; | |
} | |
var x = document.getElementById('task_x').innerHTML; | |
var y = document.getElementById('task_y').innerHTML; | |
var op = document.getElementById('task_op').innerHTML; | |
var res = document.getElementById('task_res').innerHTML; | |
var calcRes = calc(x, y, op); | |
console.log(x, op, y); | |
console.log('res', res); | |
console.log('calc', calcRes); | |
if (res == calcRes) { | |
document.getElementById('button_correct').click(); | |
} else { | |
document.getElementById('button_wrong').click(); | |
} | |
} | |
var i = 1; | |
while(i < 666) { | |
setTimeout(function() {answer()}, i++ * 100); | |
} |
hey nafiq
how can i use this code?
come on nafiq
com on
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can use ?