0032【Edabit ★☆☆☆☆☆】【每秒幀數(shù)】Frames Per Second
algorithms
language_fundamentals
math
numbers
文章來源:http://www.zghlxwxcb.cn/news/detail-718333.html
Instructions
Create a function that returns the number of frames shown in a given number of minutes for a certain FPS.文章來源地址http://www.zghlxwxcb.cn/news/detail-718333.html
Examples
frames(1, 1) // 60
frames(10, 1) // 600
frames(10, 25) // 15000
Notes
- FPS stands for “frames per second” and it’s the number of frames a computer screen shows every second.
Solutions
function frames(minutes, fps) {
return 60 * minutes * fps ;
}
TestCases
let Test = (function(){
return {
assertEquals:function(actual,expected){
if(actual !== expected){
let errorMsg = `actual is ${actual},${expected} is expected`;
throw new Error(errorMsg);
}
}
}
})();
Test.assertEquals(frames(1, 1), 60)
Test.assertEquals(frames(10, 1), 600)
Test.assertEquals(frames(10, 25), 15000)
Test.assertEquals(frames(500, 60), 1800000)
Test.assertEquals(frames(0, 60), 0)
Test.assertEquals(frames(99, 1), 5940)
Test.assertEquals(frames(419, 70), 1759800)
Test.assertEquals(frames(52, 33), 102960)
到了這里,關(guān)于0032【Edabit ★☆☆☆☆☆】【每秒幀數(shù)】Frames Per Second的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!