News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jacob Santos' Blog:
PHP Blackjack
January 24, 2007 @ 08:58:00

In a new post to his blog today, Jacob Santos shares a look at converting an application from one language to another - from C++ to PHP (obviously).

The reason I'm revisiting blackjack is because I have a C++ version and I want to port it to PHP, for fun. If you want to have a simple project for learning a language, other than "Hello World," then Blackjack is a good project.

Since Blackjack is a relatively simple game (as far as the rules go, that is) he chose a simple C++ version to port over. He sets up some guidelines first - break down the code into simple, reusable parts and keeping it as simple as possible. Most of the rest of the code is dedicated to the code:

  • Game start
  • Statistics handling
  • Randomization
  • Looping
  • Conditional statements
The transition is pretty simple, really, especially with how flexible PHP is and the large number of built in functions it comes with.

0 comments voice your opinion now!
convert port blackjack simple tutorial convert port blackjack simple tutorial


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: The ZendCon Sessions Episode 22: PHP Extension Writing

SitePoint PHP Blog: Efficient User Timelines in a PHP Application with Neo4j

Ralph Schindler's Blog: Compiling Gearman (or anything) for Zend Server CE on Snow Leopard

Builder.com.au: Quickly Install a LAMP server on Ubuntu

DevShed: Handling HTML Strings and Files with the DOM XML Extension in PHP 5


Community Events

Don't see your event here?
Let us know!


voicesoftheelephpant example extension performance api laravel application framework interview introduction library version opinion community symfony2 php7 series podcast release conference

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework