EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言:CS game代写 Introduction to Computer and Programming - C语言代写
发布时间:2021-07-25 19:37:32浏览次数:
1 Project setupAt a cross road cars are either moving if the light is green or waiting if it is red. A road is composed of two lanes, for cars going in opposite directions while the light is located on the right hand side of the cars, before the cross. Moving cars are all going at a same constant speed of one unit every second.A snapshot of the scenario at a time t is shown on Figure 1. On the picture three cars are going from top to bottom but are waiting as the traffic light is red. In the meantime five cars going from right to left are crossing, while two other cars are coming from the opposite direction. The two last cars can be seen coming from the bottom but have not yet arrived at the cross road.Requirement for the above scenario:•The user inputs n, the total number of cars, w the width of the road, and p the proba- bility that a cars does not stop at the red light;• The number of cars on each line is randomly decided with respect to n;• The color cycle of a traffic light is green for g s, orange for o s, and red for r s; The user sets the value of the variables g , o, and r ;• Lights in the diagonal of the cross road have a same color;• Each time a light changes from green to orange the cars before the light stop and the ones which have already passed it finish crossing; e.g. on Fig. 1 if the green light be-comes orange then the two cars in the middle of the cross should finish crossing the road;CS game代写• Cars should appear at the beginning of the road with respect to where they come from; e.g. a car coming from the right should start from the right most edge of the figure;• Every second all the non-waiting cars move by one unit; The goal is to animate the displacement of the cars with respect to the traffic lights. The choice of the user will impact the risk for a car crash to happen. The animation stops as soon a crash occurs and the player loses. If all the cars have gone through without any problem the player wins. 2 TasksEx. 1 — Cross road traffic game1. Write a simple function that initialises all the parameters, i.e. prompts the user for the number of cars, the time for each light color, randomly generates how many cars go in each direction, etc..2. Write a function that draws the cross road.3. Write a clear and precise algorithm describing the motion of the cars as well as the change of color of the traffic lights. Justify your choices. The algorithm should describe the whole animation of the cross road.4. Write several functions to plot the cars and animates the whole scenario of the game.Each of the following questions is optional and will bring a bonus on the project grade if properly solved.5. Design more realistic cars of various sizes.6. Allow the cars to randomly turn left or right.7. Allow cars to adjust their speed within a range specified by the user. They can in turn use this information to prevent a crash.8. Allow the player to choose a difficulty level and automatically adjust all the parameters accordingly,e.g. number of cars, width of the road, right and left turns allowed, etc..9. Add more lanes to the road.Note: other adjustments are welcome and encouraged, however first discuss them with the teaching team to check their validity and suitability for the project.Ex. 2 — Registration platesEach car features a registration plate composed one letter followed by a mix of five letters and digits,e.g. B 34HB0. We want to generate a random plate for each of the car and return the plates of all the cars which do not stop at the cross road.1. Random permutations.a) Write a recursive algorithm that takes as input a set of elements and an integer l , and returns all their permutations of length l .b) Adjust the previous algorithm to return a random subset of all the permutations containingn elements.Hint: generating all the permutations and selecting n of them afterwards in not a good idea.2. Implement the generation of the registration plates in MATLAB, and assign a unique plate to each car.3. At the end of the game display the plate of all the cars that did not stop at the traffic light. 3 MilestonesIn order to smoothen the progress and provide hints on how to get organised when working on the project we defined three milestones. For each milestone students must submit their current code with all the usual relevant files attached as well as with a short Changelog file that describes the progress done on the project. Expected implementation for each milestone:1. Crossroad and traffic light: October 2nd; 2. Car related functions (e.g. input, direction, drawing, output, plate, etc.): October 7th;3. Whole animation: October 14th; 4 FAQThis section lists all the Frequently Asked Questions (FAQ).1. I do not understand a question. What should I do?Use a monolingual dictionary to ensure you fully understand all the words appearing in the question. Then discuss with other students to know how they understand it. Only discuss the question, not its solution. If several opinions appear to be valid determine which ones is the best and most reasonable. Document your choices in the README file. Alternatively contact the teaching team through project 1 discussion on Piazza. To ensure everybody benefits from the question and its answer no question will be answered if not asked on the project discussion;2. What is w the width of the road?The width of the road is how large the road is. It can be expressed in pixels or in term of time unit,e.g. a width of 4 time units means that a car needs 4 time units to cross the cross road. Ensure the user knows what unit is used when he is prompted for w .3. The optional question requirements do not match the original scenario. What should I do?The optional requirement overwrites the original one. For instance in the original scenario the speed is uniform while in ex. 1 question 7 a car can change its speed. In that case the speed can be freely adjusted.4. Can I skip base questions and do optional ones instead?No, a submission that does not implement the basic questions will not receive any bonus.5. Can I make use of the Automated Driving System Toolbox?The project must be completed with the help of any “advanced toolbox”. Completing two versions, with and without, can bring bonus.6. I have not read the ci.pdf file, can it impact my grade?Yes, much information on the code quality appears in this file. No applying some of the rules can bring large deductions on the project grade.7. I cannot meet a milestone, how bad is it?Deductions will be applied if functions from previous milestones are not fully working in the final submission. Besides, no answer will be provided to questions on a previous milestone.最先出自315代写 cs代写 作业代写 代写c合作:315代写

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。