CSC171代写、TTY program代做、代做Python,Java,c++程序语言代写R语言编程|调试Web开发

CSC171 — Project 2TTY GolfIn this project you will build on your first project experience and develop a TTY program toplay the game of Golf. It doesn’t matter if you know how golf works—the rules of the gamethat you need to implement our version are described below. And of course you can look itup on Wikipedia: Golf.As with Project 1, the basic idea is that the program will tell the player the game situation andoffer them a choice of various actions. The player will type their choices and the program willread them, compute the result, and inform the user. This is essentially what you did last time,only for a more complicated and realistic game. You may also, for extra credit, implement acomputer opponent that plays against the human.This document contains a lot of information. First it describes the game of golf generally, andthen the abstract version of it that we will use for our TTY game. An example of what theoutput of your program might look like is provided. You should be able to start thinking aboutyour program after reading these.The section “Specifications” provides all the details that you need to put into your program inorder to actually play the game. The section “Project Design and Requirements” describesthe main aspects of the project and gives some suggestions on how to approach them. Thesection “Specific Requirements” spells out exactly what your program must do. Gradingdetails, opportunities for extra credit, and other policy details are at the end of the document.The Game of Golf (Simplified)The game of golf is played on a mostly grass-covered golf course (see Figure ). A courseconsists of 18 holes. Each hole is a more or less linear span of the course’s grassy terrain.Each hole has a tee at one end, where the players start, and a green, where the grass iscut very short, at the other end. Someplace on the green is an actual, physical hole (or cup)marked by a flag.Each player uses a set of golf clubs to hit their ball around the course. Each club has differentcharacteristics, but roughly speaking the farther a club can hit, the less accurate it is. Eachhit is called a shot or stroke.The first shot on each hole is taken from the tee. Most holes are too long for the tee shot toreach the green and get into the hole. Subsequent shots are played from where the previousshot lands and stops. Once the ball reaches the green, the player uses a special club called1Map of the Old Course at St. Andrews, Scotland.Source: supersport.comSchematic of a golf hole. 1=tee, 2=waterhazard, 3=rough, 4=out of bounds, 5=sandbunker, 6=water hazard, 7=fairway, 8=puttinggreen, 9=flag, 10=hole (cup). Source:WikipediaFigure 1: Golf course example and definitionsa putter (PUH-ter) to putt (PUHT) or tap the ball towards the hole. Getting the ball to fall intothe hole is called “sinking the putt.”The goal of the game is to get the ball into the hole in as few strokes (shots) as possible.Each hole is assigned an “expected” number of strokes, called its par. Completing a hole inthat number of strokes is called “making par.” Completing a hole in fewer strokes is calledbeing “under par;” completing it in more strokes is called being “over par.”A full game, also called a round, involves playing all 18 holes of a course in turn. A player’sscore for a round is the total number of strokes they used to complete the course. This istraditionally expressed as the difference from the total par for the course. Thus finishing inone less stroke than par is “-1” (“one under”), while finishing in one more stroke is “+1” (“oneover”).In the real game, each hole is a part of the landscape of the course. For our game, we willignore almost everything about the physical topography of the course. The holes will simplyhave a distance from tee to hole. All greens will be a fixed size and it won’t matter where onCSC171留学生作业代写、TTY program作业代做、代做Python,Java,c++程序语言作业 代写R语言编the green the hole is placed.TTY GolfIn TTY Golf, a course is represented as a set of 18 holes, each of which has a yardage(number of yards from tee to hole) and a par for the hole.2The player will play each hole of the course in turn to complete their round.For each stroke (shot) other than putting, the player will select a club (a number 1–10) andthe power with which to hit the ball (also a number 1–10). Your program will compute thedistance of the shot (details below) and inform the user of the result.The player will continue to take shots like this until ball is within 20 yards (60 feet) of the hole,at which point it is on the green.Once the ball is on the green, the player putts by specifying the power with which to hit theball (1–10). Your program will compute the distance of the putt and whether it goes in thehole (details below). The player continues to putt until the ball is in the hole.Your program will keep track of the number of strokes (shots) and the player’s score relativeto the total par of the holes they have played so far.When the game is over, your program should offer to play a new round or quit.Sample TranscriptThe following transcript is a purely hypothetical example of the sort of gameplay that yourprogram might provide. It should give you some idea of the sorts of messages and promptsthat are necessary. But you do NOT have to make your game play exactly like this. Theimportant thing is to keep the player informed about the game situation. Be very clear whatyou’re asking for when prompting for user input.Welcome to TTY Golf!Please select a course:1. Genesee Valley Park North Course2. The Old Course at St. AndrewsYour choice [1-2]: 2You are playing The Old Course at St. Andrews.You are at the first tee. 376 yards, par 4.Choose your club [1-10]: 1Power [1-10]: 10You hit the ball 236 yards. Nice!You are in the fairway.Second shot. 140 yards to the hole.3Choose your club [1-10]: 7Power [1-10]: 6You hit the ball 130 yards.You are on the green.Third shot. 30 feet to the hole.Putt power [1-10]: 5Your putt went 27 feet.You are on the green.Fourth shot. 3 feet to the hole.Putt power [1-10]: 2It’s in the hole!You made par on this hole.Your score after the first hole is: par.Type RETURN to continue to the next hole:You are at the second tee. 453 yards, par 4.Choose your club [1-10]: 1Power [1-10]: 10You hit the ball 260 yards. Nice!...Your final score for the round is: 3 under. Good job!Would you like play another round [Y/N]? YPlease select a course:...4SpecificationsCoursesYou can lookup the yardage and par of many golf courses online. To get you started, hereare the specifications for the Genesee Valley Park North Course (in Rochester) and the OldCourse at St. Andrews in Scotland, the oldest golf course in the world.Genesee Valley Park North CourseHole Yards Par Hole Yards Par1 530 5 10 433 42 305 4 11 363 43 331 4 12 174 34 201 3 13 545 55 500 5 14 419 46 226 3 15 512 57 409 4 16 410 48 410 4 17 320 49 229 3 18 170 3The Old Course at St. Andrews (yes, each hole has its own name)Hole Name Yards Par Hole Name Yards Par1 Burn 376 4 10 Bobby Jones 386 42 Dyke 453 4 11 High (In) 174 33 Cartgate (Out) 397 4 12 Heathery (In) 348 44 Ginger Beer 480 4 13 Hole O’Cross (In) 465 45 Hole O’Cross (Out) 568 5 14 Long 618 56 Heathery (Out) 412 4 15 Cartgate (In) 455 47 High (Out) 371 4 16 Corner of the Dyke 423 48 Short 175 3 17 Road 495 49 End 352 4 18 Tom Morris 357 4ClubsObviously in real-life, how far the ball travels when it is hit depends on the player, the club,and how the ball is hit. For TTY Golf, things are much simpler. We will assume the followingspecifications for the different golf clubs (based on source: about.com):转自:http://www.7daixie.com/2019030729243750.html

你可能感兴趣的:(CSC171代写、TTY program代做、代做Python,Java,c++程序语言代写R语言编程|调试Web开发)