0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second
algorithms
language_fundamentals
math
numbers
文章来源:https://www.toymoban.com/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.文章来源地址https://www.toymoban.com/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)
到了这里,关于0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!