A friend of mine thinks he can beat my score on the gild.com triangle numbers challenge. His only excuse is getting rhino setup on his MacBook to test the JS. So here is a quick and dirty approach.
- Grab the Rhino source.
- Un-zip/tar to a cool directory. I use: ‘/Users/username/Development/Tools/Rhino’
- Edit your .bash_profile file:
- Add a print statement.
- Run from the console using:
I found an issue when trying to test a js file. Because ‘rhino’ is an alias bash will not run it as a command. I found a better solution here: WorkingRhino. Check it out, or just follow my instructions below:
- Remove the rhino alias from .bash_profile or .profile.
- Create a shell script in ‘/Users/username/Development/Tools/Rhino’ named rhino
- Copy/Paste this:
- Make rhino executable with chmod u+x rhino