Wednesday, September 29, 2010
The Perfect Run Modeler - Perl version
By the way, bad programming on my part in not creating arrays. There was a good (bad) reason for that. Originally, my Markov calculator was just for me as an Excel spreadsheet. And, if you can imagine, it was hard to follow. Anyway, being lazy, I wanted to port that to Javascript with as little manual intervention as possible. So, I converted all the formulas in the spreadsheet into text, which I then just copied over to a text file, made a few changes, and voila, Javascript.
After I did that, it was so obvious that I should have turned it into arrays. For example, this is b.s. programming on my part:
state_1b_0_0
It should be:
state_bro[1][0][0]
Anyway, any of you math teachers out there who want to have a good programming example that uses baseball for your kids, I would recommend this. It’s got alot of good stuff in it, and you can get them to turn the code into arrays, and, if you want to have fun, tell them to do this: assume there are n-outs in an inning, and m-bases.
Thanks to Sobchak for rewriting it. You can view my original Javascript code by going to my Markov page and doing “view source”.


Recent comments
Older comments
Page 1 of 344 pages 1 2 3 > Last »Complete Archive – By Category
Complete Archive – By Date