CSC1002代做、Python程序设计代写
CSC1002 – Computational Laboratory
Iris - 2025
OVERVIEW
Inspired by a high school student I met in a high-school elite event organized by SSE in 2024. Her name
is Iris. In this assignment, you are going to design and develop a program to display as many polygon
shapes as possible on the canvas in random locations within a given period of time. Your program will
load the custom shapes (name and coordinates) of all the polygons from an external file, start tracking
the elapsed time and then repeatedly perform the shape-placement operation. Initially the canvas is
empty. The shape-placement operation picks a random polygon shape, a random color and a random
pair of x, y coordinates, trying to position the chosen polygon on the canvas at the chosen x, y
coordinate, on condition that it is completely separate from all other polygons already drawn on the
canvas. If it fails, your program repeatedly attempts to place the same polygon in another location by
choosing another random pair of x, y coordinates. No polygon can be placed within another polygon
and any polygon cannot touch or overlap any other polygons. The placement operation ceases any
further attempts for another polygon once the elapsed time has expired. The duration length is defined
by the user at the program's launch. Please refer to the scope for detailed requirements.

CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
SCOPE
1. Drawing Canvas - Use module “turtle” to create the drawing canvas, 75% width and 75% height
of computer’s screen resolution, positioned at the center of the computer’s screen.
2. Input - prompt the user to enter the following information:
a. Stretch Value - a value used to resize polygon in both width and height. Default is 1.
b. Duration - total number of seconds to place random polygons on canvas. Default is 5.
c. Random Seed - the seed value used to initialize the random module. Default is 1.
d. Terminate - ‘y’ or ’n’. Default is ’n’
3. Termination
a. after the duration is up, the program stops placing additional polygons on the canvas
and then shows the total count of polygons successfully displayed on the canvas. In the
title bar of the canvas, show your student ID, the time the operation started and ended,
elapsed time (seconds) and the number of polygons displayed:
and simply print the polygon count with your student ID on the console:
b. Change the background color of the canvas to black.
c. if “Terminate” is ‘y’ then exit the program immediately; otherwise do nothing and keep
the canvas active so that TA can verify the positions of polygons on the canvas.
4. Custom Shapes - the names and coordinates of all polygons are given in an external file called
shapes.txt. Ensure the mode of the screen is set to “logo” and register the custom shapes using
addshape(name, coordinates).
5. Shape-Placement Operation
a. Track the elapsed time
b. Pick a random color - from a predefined list of colors (see template file).
CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
c. Pick a random polygon shape
d. Stretch the chosen polygon in both x and y directions and set the shape color
accordingly using the following methods:
i. shapesize(value, value)
ii. color(value)
e. Try repeatedly placing the chosen polygon on the canvas at a random location:
i. pick a random x, y coordinates
ii. show the polygon at the chosen x, y coordinates if the following conditions are
met:
1. no further adjustment is allowed to the polygon including rotation,
heading adjustment, shearing, etc.
2. simply call goto(x, y) to move the chosen polygon
3. the polygon must be completely separate from all other polygons
already drawn on the canvas
4. the polygon cannot be placed within another polygon
5. the polygon cannot touch or overlap any other polygons
iii. if the condition isn’t met and there is more time to continue, repeat the above
steps.
f. track of the number of polygons successfully shown on the canvas.
g. Repeat all the steps above until the total elapsed time (in seconds) exceeds the entered
duration.
6. Template File - follow the provided template file to complete the assignment.
NOTE:
• Keep your entire source code in ONE SINGLE file.
• Use only Python modules as specified in the “Permitted Modules” section.
• In your design stick ONLY to functions, in other words, no class objects of your own.
o Furthermore, the lines of code containing the sub-function(s) defined within another
function will be counted as part of the parent function.
o NOTE: Failure to adhere to the instructions outlined in the assignment handout will
result in a 50% reduction in the coding style score.
CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
STARTUP OPTIONS
Not applicable
SKILLS
In this assignment, you will be trained on the use of the followings:
• Refactoring - logic reuse or simplification based on the existing logic.
• Variable scope: global, local and function parameters.
• Coding Styles (naming convention, meaningful names, comments, doc_string, …etc)
• Problem Decomposition, Clean Code, Top-Down Design
• Functions (with parameters and return) for program structure and logic decomposition
• Standard objects (strings, numbers & lists)
• Variable Scope
PERMITTED MODULES
Only the following Python module(s) is allowed to be used:
• turtle
• random
• time
DELIVERABLES
Program source code (A2_School_StudentID.py), where School is SSE, SDS, SME, HSS, FE, LHS, MED and
StudentID is your 9-digit student ID.
For instance, a student from SME with student ID “119010001” will name the Python file as follows:
• A2_SME_119010001.py:
Ensure that your source file is saved in standard, regular UTF-8 encoding format. On the status bar of
Visual Studio Code, you can view the current encoding format as follows:
On an occasion, the encoding scheme is set to UTF-8 with BOM as follows:
CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
The presence of the Byte Order Mark (BOM) could be due to copying from websites, older versions of
editor, file conversion from other sources, default encoding settings, and so on.
Confirm the encoding scheme is UTF-8 and the file name is correct, then submit the plain program file to
the corresponding assignment folder. A deduction of 5% will be penalized if the file is incorrectly named
or in wrong encoding format.
TIPS & HINTS
• Apply problem decomposition, Clean Code and Refactoring as illustrated during classes.
• Beware of variable scope as you might keep a few variables as global such as current editor
content, cursor position, undo buffer, and so on.
• Refer to Python website for program styles and naming conventions (PEP 8)
CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
SAMPLE OUTPUT
NOTE: REFER TO THE SCOPE FOR THE REQUIRED INFORMATION TO BE DISPLAYED IN THE TITLE BAR OF THE TURTLE
GRAPHICS WINDOWS.
CSC1002 – 2025 Winter By Kinley Lam
CSC1002 – Computational Laboratory
MARKING CRITERIA
• Coding Styles – overall program structure including layout, comments, white spaces, naming
convention, variables, indentation, functions with appropriate parameters and return.
• Program Correctness – whether or the program works 100% as per Scope.
• User Interaction – how informative and accurate information is exchanged between your
program and the player.
• Readability counts – programs that are well structured and easy to follow using functions to
break down complex problems into smaller cleaner generalized functions are preferred over a
function embracing a complex logic with many nested conditions and branches! In other words,
a design with a clean architecture and high readability is the predilection for the course
objectives over efficiency. The logic in each function should be kept simple and short, and it
should be designed to perform a single task and be generalized with parameters as needed.
• KISS approach – Keep It Simple and Straightforward.
• Balance approach – you are not required to come up with a very optimized solution. However,
take a balance between readability and efficiency with good use of program constructs.
DUE DATE
April 6th, 2025, 11:59:00PM
ITEMS PERCENTAGE REMARKS
CODING STYLES 50%-60% 0% IF PROGRAM DOESN’T RUN
FUNCTIONALITY 50%-60% REFER TO SCOPE
CSC1002 – 2025 Winter By Kinley Lam

热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图