Thursday, July 30, 2015

More Programming

So.  After a bit of time away, I finally had some time to work on programming.  I’ve been working on the idea of a program that teaches speed reading.  Essentially, the goal is to present words to a sentence faster than the subject can normally read.  Sounds like a great idea, right?  Except that Java isn’t really a real time system, so getting threads to sleep for 240 milliseconds just doesn’t work.  That would equate to 250 words per minute reading pace. 

What I end up getting is entire lines of the text, in speeds that are considerably less than 250 words per minute.  Though… a little messing and reading made me realize my conversion factor was off.  It seemed like the answer should be…

(1000 milliseconds X 60 seconds) / (word per minute pace)

I revamped the equation to take a different method.  I think I was running into too many float to integer conversion errors.  Or at least that’s what I’m going to blame. 


But it looks like Java can’t do that kind of precision in waiting.  Googling lead me to a lot of the same answer.

If the speed is slow enough then the pacing works correctly.  But it looks like either 1) Java isn't capable of printing 1 piece of string at a pace of less than 300 ms, or 2) I'm not a capable enough programmer.  

So, that's that.  Perhaps it's time to go back to looking at C++.  

No comments:

Post a Comment