1 / 11

Learning C++ the Fun Way

Learning C++ the Fun Way. Taesoo Kim Dr. Ramon Lawrence Computer Science. About C++. Widely known Introduced 2nd year of college Difficult task to learn Taught by doing programming projects Making a game in C++ is a fun assignment. Goals of the project.

yoshiko
Download Presentation

Learning C++ the Fun Way

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Learning C++ the Fun Way Taesoo Kim Dr. Ramon Lawrence Computer Science

  2. About C++ • Widely known • Introduced 2nd year of college • Difficult task to learn • Taught by doing programming projects • Making a game in C++ is a fun assignment

  3. Goals of the project • Construct infrastructure for teaching C++ • Critical Mass • Motivate students to program • Allow students to play over the internet • Test student’s game implementations

  4. How the game is played

  5. Components of Infrastructure • The applet is written in Java • CriticalMass.java • Displays the game • Applet runs in internet browsers • The core of the game is written in C++ • CM.h • AI of the game • What students write and upload • Linkage between Java file and C++ file • CriticalMass.cxx • MySQL database contains C++ code and user information

  6. How the Infrastructure works

  7. How the graphical aspect of the game works • Applet initializes 5 x 6 matrix • Matrix contains square information • Applet draws the board • Grid • Bombs

  8. Sample design of the core • The Move Generator • Goes through every square and tries to insert a bomb • If it can’t moves to the next square • The Board Evaluator • Point system • 6 - corner, 5 - sides, 4 - interior • add the points. Better boards will have a higher sum • reason for specific point value • Who has the most bombs in the best position

  9. Continued... • The Game Tree • built by recursion • makes every valid move and creates the board corresponding that move • makes an opponent move in response • makes another move in response • evaluates using the board evaluator and picks the best • assumes that each player will make the best move

  10. Conclusion • Attract students to program often • Encourage competition among students • Motivate students to improve their work

  11. END...

More Related