Skip to content

Instantly share code, notes, and snippets.

@vsnikkil
Last active December 14, 2017 11:34
Show Gist options
  • Save vsnikkil/f0fd7788a6f08454e905a0ba5469b537 to your computer and use it in GitHub Desktop.
Save vsnikkil/f0fd7788a6f08454e905a0ba5469b537 to your computer and use it in GitHub Desktop.
try-me
const a = (idx = 1, color = 'black') => { console.log(`%c ${ [...new Array(Math.round(50*(1+Math.sin(idx/10))))].map(() => '*').join('') }`, `color: ${color}`); setTimeout(() => a(idx+1, color), 20) }; a()
// Node
var x = idx => { console.log(''.padStart(Math.floor(process.stdout.columns / 2 * (1 + Math.sin(idx))), '*')); setTimeout(() => x((idx + 0.1) % (2 * Math.PI)), 20) }; x(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment