BartMassey / ttt-bench

Tic-Tac-Toe benchmark in various languages
Other
17 stars 4 forks source link

Added php version #3

Closed arc3x closed 8 years ago

arc3x commented 8 years ago
BartMassey commented 8 years ago

Thanks!

Having fixed that and converted , it seems to work fine. Go ahead and add a commit that fixes these (preferably by initializing the initial board in a loop) and I'll push pull. Or I can just merge my fixes on top of yours. Let me know.

Nice to know that Haskell and PHP have comparable performance. I'll be trolling /r/haskell shortly. What version of PHP are you running on what platform? I'm php5 on Linux. Are there optimization flags for PHP?

Again, thanks!

arc3x commented 8 years ago

All done.

Im on php 5.5 on OSX Yosemite. I'm not aware of any optimization flags and caching doesn't seem to help runtime of this.

Sorry about the bugs, strange that it ran for me and not you. Php dynamically resizes your arrays for you as you try to access new dimensions/areas so the array was there, but not initialized to 0 until negamax returns and sets it.

BartMassey commented 8 years ago

Thanks much for the code! I've updated the README to reflect it. It runs faster than I thought.