Skip to content

Instantly share code, notes, and snippets.

@elado
Created May 26, 2017 00:48
Show Gist options
  • Save elado/609f84e2e682e853be6ced332cab39e4 to your computer and use it in GitHub Desktop.
Save elado/609f84e2e682e853be6ced332cab39e4 to your computer and use it in GitHub Desktop.
cryptocurrency.js
let valueInUSD = 1
setInterval(() => {
valueInUSD = Math.max(valueInUSD + (Math.random() >= 0.5 ? 1 : -1) * Math.random() / (5 * Math.random()), 0.1)
console.log('valueInUSD', valueInUSD)
}, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment