Monopoly is a board game that involves buying and selling property. It has been converted to software already, but that shouldn't stop you from making your own version of it. Before you tackle this project, which requires computer programming skills, study existing Monopoly clones to see what new features they've added to the original game. Also, learn basic programming skills by installing a free development kit and experimenting with its sample programs. Making your own Monopoly game teaches programming skills you can use for other applications, including non-game ones.
- Skill level:
Play a few Monopoly-style games for the computer, such as Monopolie and Capitalism. These are open source games, which means they're free and you can study their source code.
Use your word processing program to open the source code for one of the games and read its statements. You'll see many comments explaining what the code does, and how it stores and manages data.
Write your own comments for statements that don't have any, but nevertheless seem clear to you. For example, you may read the statement "PickACard();" and write "the code is calling for a function that simulates choosing a card." Your goal is to fill the source code with comments. To do this task you need to understand the code and be able to modify it.
Download and install a compiler for the game's programming language; the game's documentation will mention this language. You can get Java compilers from Oracle's website, and C# compilers from the Microsoft website.
Compile the program, then execute it one statement at a time. This is called stepping through the code, and makes the workings of the program easy to comprehend.
Write new comments in the source code based on the knowledge you've gained from stepping through the code. You won't understand every statement on the first session of code-stepping, so repeat the last step and this one until you have each statement commented. Then you can begin making changes to the game.
Look in the source code for statements that have text or numbers, such as the hypothetical statement "Player1.Color = 'blue';" Change statements to have new constants similar to the original constants. For example, you might change the "blue" in this statement to "red." Make as many of this type of changes as the code allows, then recompile the game.
Re-read the comments you wrote in step 6, then revise any statement that doesn't have the constants referred to in step 7. Your comments will provide the knowledge you need to make changes, such as altering the appearance of the player tokens and gameboard, and modifying the rules of the game.
Repeat step 8 until the game you originally downloaded is undetectable. When this happens, you've completed your own Monopoly program.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for