This file contains hidden or 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
'use strict'; | |
/** | |
* Generate betamap | |
* @param {Number} bpm beats per minute | |
* @param {Number} length duration of the song in seconds | |
* @param {Number} rate samples per second | |
* @return {Array} beatmap | |
*/ | |
function generateBeatMap(bpm, length, rate) |
This file contains hidden or 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
'use strict'; | |
// pure bottom-up recursion | |
function getNumberPure(r, c) { | |
if (0 == c) return 1; | |
if (0 == r || c == r) return 1; | |
else return getNumberPure(r-1, c-1) + getNumberPure(r-1, c); | |
} | |
// bottom-up recursion with memorization |
NewerOlder