当前位置:首页 > 编程笔记 > 正文
已解决

0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second

来自网友在路上 156856提问 提问时间:2023-10-28 04:31:24阅读次数: 56

最佳答案 问答题库568位专家为你答疑解惑

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)
查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second":http://eshow365.cn/6-26563-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!