02-16-2010, 06:00 PM
On #lobby (irc.echelon4.net), SumWon wanted to see how many virtual monkeys it took to type BANANA given a six-key limit and a keyboard with all keys except Shift, Tab, *Lock, Enter, F1, F2, Esc, etc. in C++
The practice later caught on with myself making a PHP version, another user (Chris) making a Python version, another user (Clinteger) making a Python version, and the chain continued.
I'll post my code here for you guys to see and, if you wish, use, but BE AWARE:
There is also another script that automatically post the results to twitter (written in bash, requires cURL), and another script the twitter script depends on (this one's written in PHP) to format the monkey number into their proper place values.
PHP Monkey Script
(click to find Pastie entry)
PHP Script to support Bash Script
Bash Script
(click to find Pastie entry)
Requires extra configuration
Follow me on Twitter @MonkeysLikeCode.
No monkeys were harmed in the making of this program.
The practice later caught on with myself making a PHP version, another user (Chris) making a Python version, another user (Clinteger) making a Python version, and the chain continued.
I'll post my code here for you guys to see and, if you wish, use, but BE AWARE:
- The PHP.ini is edited to allow 350 MB RAM usage and unlimited execution time.
- This is NOT executed on a web page. This is done purely on the command line interface.
- This is done on my OWN SERVER, NOT another server or VPS. Executing this on a website will get you killed by the host police.
There is also another script that automatically post the results to twitter (written in bash, requires cURL), and another script the twitter script depends on (this one's written in PHP) to format the monkey number into their proper place values.
PHP Monkey Script
(click to find Pastie entry)
PHP Script to support Bash Script
PHP Code:
<?php
echo number_format($_REQUEST['number']);
// Yep, that simple.
Bash Script
(click to find Pastie entry)
Requires extra configuration
Follow me on Twitter @MonkeysLikeCode.
No monkeys were harmed in the making of this program.




