Entraînement au calcul mental

Module pour le développement de ses capacités de calcul mental, basé sur des opérations aléatoires.

by Orikrin1998

JavaScript

// Comment forcer le calcul ?

var a1 = Math.floor((1000) * Math.random() + 2)
var a2 = Math.floor((1000) * Math.random() + 2)
var b1 = Math.floor((1000) * Math.random() + 2)
var b2 = Math.floor((1000) * Math.random() + 2)
var c1 = Math.floor((1000) * Math.random() + 2)
var c2 = Math.floor((1000) * Math.random() + 2)
var d1 = Math.floor((1000) * Math.random() + 2)
var d2 = Math.floor((1000) * Math.random() + 2)
var e1 = Math.floor((1000) * Math.random() + 2)
var e2 = Math.floor((1000) * Math.random() + 2)
var f1 = Math.floor((1000) * Math.random() + 2)
var f2 = Math.floor((1000) * Math.random() + 2)
var g1 = Math.floor((1000) * Math.random() + 2)
var g2 = Math.floor((1000) * Math.random() + 2)
var h1 = Math.floor((1000) * Math.random() + 2)
var h2 = Math.floor((1000) * Math.random() + 2)
var i1 = Math.floor((1000) * Math.random() + 2)
var i2 = Math.floor((1000) * Math.random() + 2)
var j1 = Math.floor((1000) * Math.random() + 2)
var j2 = Math.floor((1000) * Math.random() + 2)

var operators = ["+", "-", "*", "/"]
var operator = operators[Math.floor(Math.random() * 4)]

var calc1 = a1 + " " + operator + " " + a2
var result1 = a1 + operator + a2

alert(calc1)
alert(result1)