This repository has some solutions to problems from the book Digital Dice: Computational Solutions to Practical Problems by Paul J. Nahin.
You can preview the book online in Google Books.
I've only finished a couple problems, and so far have written answers in Ruby, and some in Python, MATLAB, and Javascript, partially as a way to compare languages.
For the Ruby solutions, you need Ruby >= 1.9.x, only because I use methods from the class Random
instead of Math
, and because 1.9.x is way faster. I recommend installing Ruby versions via rvm.
The Javascript solutions require Node.js. I recommended you install via nvm.
The MATLAB solutions can be run via the open-source GNU Octave.
I've included MATLAB solutions that are very similar to the ones in the book for the introduction and first chapter only, since both of these solutions are available freely online at the book's official web page.
I'm not sure if I'll do more of my own solutions in MATLAB since Octave (or maybe MATLAB?) is very slow compared to Ruby, Python, or Javascript.
Interestingly, the Python scripts are the slowest to run, but that is using Python 2.7. That may also change with more complicated solutions.