Team Project Specification – “Outsmart the Computer” Due: 11:59 P.M. Tuesday, April 25, 2017 The project is to design and write a C++17/FLTK computer game program with a graphical user interface. The object of the game is to keep the computer from guessing the player’s next choice of two possible values. We will call the choices “heads” and “tails” below, but you are free to use maroon/white, on/off, up/down, 0/1, etc. instead. The player starts by making a certain number of choices, attempting to be as random as possible, which the computer observes. Then for each of the following choices the computer guesses in advance, and then compares its guess to the next choice. For difficulty level 1 (see below) there are 32 choices in the observation phase and 32 choices in the guessing phase. The player earns 10 points for each choice the computer guessed wrong, so for difficulty level 1 the maximum score is 320. The program must: 1. Start with an attractive splash screen showing (at least) the name of the game, the team number, and the team members’ names. Feel free to add team members’ pictures, play music, etc. Have a START button which then explains how to play the game. 2. Ask for a difficulty level from 1 to 5; this determines the number of rounds to play, 32/64/128/256/512 respectively. Display the top 5 scores for that difficulty level (read in from the disk; the top scores file starts out empty). 3. Ask for the player’s initials and display them with a blank score below the top 5 scores. 4. Instruct the player to make that many choices, attempting to be as random as possible, and show how many choices remain. For example, for difficulty level 1 the setup screen might say “You have 32 choices to go; click Heads or Tails.” Remember to redraw the screen each time you change a graphical object! 5. After that, for each of the next 32 player choices (for difficulty level 1), the computer first makes a secret guess based on the percentage of heads for the most recent 32 choices. For example, if the program calculates that 75% of the most recent 32 choices were heads, then 75% of the time it will guess that the next choice will be heads and 25% of the time it will guess that the next choice will be tails. When the computer has made its secret guess, tell the player to choose and then have the computer say something like “I guessed right—no points for you!” or “You outsmarted me—10 points for you!” 6. When all the guessing rounds are done, add the player’s score and initials to the scores list, sort the list of 6 scores, and write the top 5 out to disk with initials. Then the next time the game is played, that file will be read in and displayed in step 2 above. Ask the player if they want to play another game or quit. EXTRA ITEMS • Add a countdown timer to limit the player to 5 seconds per move. If time expires then say “Time’s up! No points! Next move?” Display a digital clock with the time remaining. Hint: Check the online FLTK documentation for Fl::add_timeout. Note: A timeout just reduces the number of remaining choices in this guessing round (thereby reducing the maximum player score). • Visually display the per cent of the times the computer has guessed correctly so far in this game. • Modify the game to have three choices, e.g., red/white/blue, 1/2/3, etc. ________________________________________________________________________ This is a team project, with three or four students on a team. The instructor will assign the teams. (Note: If there are any problems with your team assignment, please talk to your TA promptly.) Divide up the code, with each student on a team of 3 doing two of the six items on page 1. If you have a fourth team member, that person must do one of the extra items. A team of 3 will receive 5 points extra credit for doing one “Extra Item” or 10 points for doing two. A team of 4 will receive 5 points extra credit for doing a second “Extra Item.” You must use at least two C++11 or C++14 or C++17 features, such as auto and range-based for. (See the reference pages on http://cplusplus.com/ to see if a feature is C++11 or C++14 or C++17.) You must write at least two classes of your own, with separate header and implementation files. Follow good style, and limit each function to no more than 24 lines (one terminal window). Each team member is expected to have a rough idea of how all the code works, and should be able to explain in detail how their own part of the code works. Choose a clever name for your team (but keep it clean ). Be creative in deciding how to meet these specifications in an attractive and user-friendly way, but get the basic functionality working before you try to make it too fancy, or you may run out of time! All user input and output must be through the GUI, not the console window. However, you may use the console window for printing debugging messages for the developers (your team). Your program should compile and run without change on the Visual C++ 2015 environment in the lab or build.tamu.edu with g++ -std=c++17 and X windows. Your program must be submitted both to CSNET and also on a CD or DVD. The project report (described below) should be submitted on paper to your TA, along with your CD or DVD. You only need to submit one report and CD or DVD and CSNET file per team. Write a report according to the outline below. All team members will receive the same project grade, unless some team member does not do his/her part (see report outline below). Important! You must demonstrate your project to your TA or it will not be graded! Note about teamwork: Immediately exchange contact information with your teammates and schedule times to meet and work on the project. If your teammates are in the same lab section, you have the two hours per week during lab, but in any case you need to schedule meeting times outside of lab. As meeting scheduling can be difficult, use this lab time wisely! Attendance will be taken during lab, so that complaints of “We could never find a time to meet” will not be taken seriously. REPORT OUTLINE The project report must be printed on a laser printer. The report should include the following sections: 1. Team information (team name, members’ names, who did what, did each member do a fair share of the work) 2. Statement of the problem, significance, etc. 3. Restrictions and limitations 4. Explanation of your approach (analysis to choose a strategy for programming the project, how you coded it, etc.) 5. Sample run (screen shots) 6. Results and analysis 7. Conclusions – What did you show? What did you learn? 8. Future research (how your program could be improved or extended) 9. Instructions on how to run your program 10. Listing of the COMMENTED program 11. Bibliography – references used, if any
checkyourstudy.com Whatsapp +919891515290