本文主要是介绍0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second
algorithms
language_fundamentals
math
numbers
Instructions
Create a function that returns the number of frames shown in a given number of minutes for a certain FPS.
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的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!