Created
November 9, 2012 04:08
-
-
Save louisje/4043654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logger = console.log;//<?php function logger($msg) {echo "\n".$msg;}; | |
function fibonacci($seq) { | |
if ($seq < 2) { | |
return $seq; | |
} else { | |
return fibonacci($seq - 1) + fibonacci($seq - 2); | |
} | |
} | |
logger(fibonacci(10)); | |
/** | |
* The code above can be both compatible with JS and PHP. | |
* I think I can write a program compatible both. | |
* | |
* @gist https://gist.github.com/4043654 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment