Last active
April 4, 2018 07:18
-
-
Save lightdiscord/43daf68c949faf8d93ab9281c86dfd4a to your computer and use it in GitHub Desktop.
f(x)=x²
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
const forms = [ | |
() => { | |
const limits = [...new Array(2)].map(()=>~~(Math.random()*40)-20) | |
const symbols = ['<', '≤'].map((v,i,a)=>a[~~(Math.random()*a.length)]) | |
return `${Math.min(...limits)}${symbols[0]}x${symbols[1]}${Math.max(...limits)}` | |
}, | |
() => { | |
const symbols = ['<', '≤', '=', '≥', '>'] | |
return `x${symbols[~~(Math.random()*symbols.length)]}${~~(Math.random()*40)-20}` | |
} | |
] | |
const value = forms[~~(Math.random()*forms.length)] | |
console.log(value()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment