tdscott10 / Tetris

SER216 Final Project
0 stars 0 forks source link

2 Bugs - Clock.java setCyclesPerSecond() #7

Closed johnolin closed 8 years ago

johnolin commented 8 years ago

Hey guys, like I said in my email I found a couple bugs in the clock class from manually going through it, specifically in the setCyclesPerSecond() method. I came across two bugs here. First of all, we have a possible division by zero here with the expression, so I added a condition for this. Secondly, the expression of (1.0f / cyclesPerSecond) * 1000 converts to 1000 seconds / cycle. Now it says we are looking for milliseconds per cycle, so to correct this I just changed the expression to (1.0f / cyclesPerSecond) / 1000. As I also said in the earlier email, I went through this with my tutor and we thought the only possible automated test case was a sleep command to count the cycles. The class just doesn't return much as I said. Also I am having trouble pushing my code so I can maybe try to figure that out in class tomorrow.

tdscott10 commented 8 years ago

Split into 2