99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP9021代做、代寫Python編程語言
COMP9021代做、代寫Python編程語言

時間:2025-04-28  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



Assignment 2 version 1.2
COMP9021, Trimester 1, 2025
1 General matters
1.1 Aim
The purpose of the assignment is to:
• develop your problem solving skills;
• design and implement the solutions to problems in the form of medium sized Python programs;
• design and implement an interface based on the desired behaviour of an application program;
• organise code into classes and implement special methods;
• possibly practice using the re and numpy modules;
• optionally practice the design and implementation of search techniques, with recursion as a good
approach.
1.2 Submission
Your program will be stored in a file named tangram.py. After you have developed and tested your
program, upload it using Ed (unless you worked directly in Ed). Assignments can be submitted more
than once; the last version is marked. Your assignment is due by April 28, 11:59am.
1.3 Assessment
The assignment is worth 13 marks, plus 5 bonus marks. It is going to be tested against a number of
inputs. For each test, the automarking script will let your program run for 30 seconds.
Assignments can be submitted up to 5 days after the deadline. The maximum mark obtainable reduces
by 5% per full late day, for up to 5 days. Thus if students A and B hand in assignments worth 12 and 11,
both two days late (that is, more than 24 hours late and no more than 48 hours late), then the maximum
mark obtainable is 11.7, so A gets min(11.7, 12) = 11.7 and B gets min(11.7, 11) = 11.
The outputs of your programs should be exactly as indicated.
Important notice:
• The bonus mark is an option only for programs submitted by the deadline, NOT for
programs submitted within 5 days after the deadline.
• The final mark for the course is capped to 100; the bonus mark cannot let you score more than 100
in the course.
1.4 Reminder on plagiarism policy
You are permitted, indeed encouraged, to discuss ways to solve the assignment with other people. Such
discussions must be in terms of algorithms, not code. But you must implement the solution on your
own. Submissions are routinely scanned for similarities that occur when students copy and modify other
people’s work, or work very closely together on a single implementation. Severe penalties apply.
1
2 Tangram puzzles and the TangramTikz package
See Tangram for an overview on Tangram puzzles. All shapes under consideration consist of a unique
connected component without inside hole.
We play with 2 large triangles, a medium triangle, 2 small triangles, a square and a parallelogram of
the following sizes in centimetres, first positioned as shown, the red dot playing the role of an “anchor”.
2
2
2
1
1
1
1
1
1
1
Each piece can be flipped about the vertical line that goes through the anchor, flipped about the
horizontal line that goes through the anchor, and rotated about its anchor (as if it was a pivot) by a
multiple of 45 degrees, before being moved to let the anchor be positioned at given x- and y-coordinates.
We work with .tex files, any of which can be given as argument to pdflatex to generate a .pdf file.
• Here is a .tex file for the solved Tangram of a kangaroo, and here is the associated pdf file.
• Here is a .tex file for the solved Tangram of a cat, and here is the associated pdf file.
• Here is a .tex file for the solved Tangram of a goose, and here is the associated pdf file.
More precisely, the .tex files we work with have the following structure:
\documentclass{standalone}
\usepackage{TangramTikz}
\begin{document}
\begin{EnvTangramTikz}
...
\end{EnvTangramTikz}
\end{document}
Between \begin{EnvTangramTikz} and \end{EnvTangramTikz} are 7 lines, one for each piece, that read
as:
\PieceTangram[TangSol](...,...){...}
or as
\PieceTangram[TangSol]<...>(...,...){...}
... between the curly braces at the end is one of
2
• TangGrandTri for any of the two large triangles,
• TangMoyTri for the medium triangle,
• TangPetTri for any of the two small triangles,
• TangCar for the square, and
• TangPara for the parallelogram.
Both ... within the pair of parentheses are for the x- and y-coordinates of the point where the anchor
of the piece has to be moved, after the piece has been possibly flipped and rotated. These coordinates
are of the form a, a+sqrt(2), a-sqrt(2), a+b*sqrt(2), a-b*sqrt(2), sqrt(2), +sqrt(2), -sqrt(2)
or a*sqrt(2) where a and b are integers or floating point numbers with b being 0 or strictly positive.
Floating point numbers have a dot in their representation. When positive, a can start with + whereas
b can’t. Floating point numbers can start with any number of 0s, and 0 before the dot is optional in
floating point numbers whose absolute value is smaller than 1 (essentially, any sequence of digits and one
dot that Python accepts as a floating point literal is valid).
... between the less than and greater than signs is for one, two or three distinct options, consecutive
options being separated by a comma. The possible options are:
• xscale=-1, to flip the piece so left becomes right and right becomes left,
• yscale=-1, to flip the piece so top becomes bottom and bottom becomes top, and
• rotate=_ with _ an integer that is a multiple of 45 (positive values are for anticlockwise rotation,
negative values are for clockwise rotation).
The options can appear in any order; their sequence determines the order in which the associated trans formations are applied to the piece. It is always possible to have either no option, or a rotation, or an
x-flip (that is, a flip about the vertical line that goes through the anchor), or a rotation followed by an
x-flip.
In the whole .tex file, there can be blank lines and whitespace (space and tab characters) between
tokens everywhere. Also, the leftmost occurrence of a % marks the beginning of a comment that runs
from this symbol included all the way to the end of the physical line, including the \n character.
3
3 The tasks to perform
Your program will allow TangramPuzzle objects to be created from .tex files that you can assume are
stored in the working directory, and whose contents satisfy all conditions spelled out in Section 2.
3.1 Reporting on the transformations applied to each piece (3 marks)
A TangramPuzzle object has a transformations attribute, whole value is a dictionary with 7 keys,
one for each piece. The keys are 'Large triangle 1', 'Large triangle 2', 'Medium triangle',
'Small triangle 1', 'Small triangle 2', 'Square' and 'Parallelogram'. The order of the large
and small triangles are given by the order they have in the .tex file. More generally, the keys of the
dictionary are created in the order of the corresponding pieces in the .tex file. The value for each key is
itself a dictionary whose keys are 'rotate' and 'xflip' . The value for 'rotate' is an integer between
0 included and 360 excluded. The value for 'xflip' is either True or False. So the transformation
applied to each piece is normalised, consisting of first a rotation (maybe equal to 0) possibly followed by
an x-flip.
Here is a possible interaction.
3.2 Reporting on the coordinates of the vertices (4 marks)
Printing out a TangramPuzzle object outputs for each piece, the coordinates of the vertices.
• Pieces are listed from the ones whose leftmost topmost vertices are highest to the ones whose leftmost
topmost vertices are lowest. When the heights of the leftmost topmost vertices of two pieces are
the same, the piece that is to the left of the other piece is listed first. Essentially, the plane is
scanned from top to bottom and from left to right and when the leftmost topmost vertex of a piece
is encountered, the piece is listed.
• Coordinates have the simplest possible form, as shown in the provided examples here. Binary +
and - have a space on both sides, there is no addition of 0, there is no multiplication by 0, there
is no multiplication by 1 or -1, fractions are simplified, integers are used instead of fractions whose
denominator would be 1, and fractions are surrounded by parentheses when followed by √2 to avoid
that it be wrongly believed that √
2 is multiplied by the denominator.
• For a given piece, the enumeration of vertices proceeds clockwise starting from the leftmost topmost
vertex.
3.3 Creating a file to represent the pieces of the solved puzzle (3 marks)
The TangramPuzzle class has a draw_pieces() method that takes the name of a .tex file as argument,
to represent a solved tangram using the tikz package rather than the TangramTiks package, easily taking
advantage of what has been done for the previous part. The order of the pieces, the order of the vertices
of a given piece, are the same as for the previous part. The origin of the plane is represented by a red dot.
The grid in the background extends in such a way that there is at least one square (of 5mm by 5mm)
and strictly less than 2 squares above the topmost vertex, to the right of the rightmost vertex, below
the bottommost vertex and to the left of the leftmost vertex. For example: if the x-coordinate of the
rightmost vertex of the shape is equal to 3.01 or 3.5, then the grid extends to the right to an x-coordinate
of 4; if the x-coordinate of the rightmost vertex of the shape is equal to 3.51 or 4, then the grid extends
to the right to an x-coordinate of 4.5.
Executing
$ python3
...
>>> from tangram import *
4
>>> TangramPuzzle('kangaroo.tex').draw_pieces('kangaroo_pieces_on_grid.tex')
>>> TangramPuzzle('cat.tex').draw_pieces('cat_pieces_on_grid.tex')
>>> TangramPuzzle('goose.tex').draw_pieces('goose_pieces_on_grid.tex')
produces this, this and this .tex files, respectively, with this, this and this associated .pdf files.
It is advisable to make sure that the spaces in the .tex files produced during the interaction are
exactly as shown. Still, whitespace will be ignored for assessment purposes, but of course, all other
nonspace characters have to be exactly the same, character for character, with all lines in the same order.
3.4 Creating a file to represent the outline of the solved puzzle (3 marks)
The TangramPuzzle class has a draw_outline() method that takes the name of a .tex file as argument,
to represent a solved tangram by drawing the outline of its shape as opposed to each piece, starting
from the leftmost topmost vertex and moving in a clockwise direction. Straight line segments extend as
much as possible between vertices. Again, the origin is represented by a red dot. Again, the grid in the
background extends in such a way that there is at least one square (of 5mm by 5mm) and strictly less
than 2 squares above the topmost vertex, to the right of the rightmost vertex, below the bottommost
vertex and to the left of the leftmost vertex.
Executing
$ python3
...
>>> from tangram import *
>>> TangramPuzzle('kangaroo.tex').draw_outline('kangaroo_outline_on_grid.tex')
>>> TangramPuzzle('cat.tex').draw_outline('cat_ouline_on_grid.tex')
>>> TangramPuzzle('goose.tex').draw_outline('goose_outline_on_grid.tex')
produces this, this and this .tex files, respectively, with this, this and this associated .pdf files.
Again, it is advisable to make sure that the spaces in the .tex files produced during the interaction
are exactly as shown. Still, whitespace will be ignored for assessment purposes, but of course, all other
nonspace characters have to be exactly the same, character for character, with all lines in the same order.
3.5 Solving a puzzle (5 bonus marks)
A function solve_tangram_puzzle() takes a file name as argument and returns a TangramPuzzle object,
making the following interaction successful:
$ python3
...
>>> from tangram import *
>>> solve_tangram_puzzle('kangaroo_outline_on_grid.tex').draw_pieces('solved_kangaroo.tex')
>>> solve_tangram_puzzle('cat_outline_on_grid.tex').draw_pieces('solved_cat.tex')
>>> solve_tangram_puzzle('goose_outline_on_grid.tex').draw_pieces('solved_goose.tex')
>>> ^D
$ diff kangaroo_pieces_on_grid.tex solved_kangaroo.tex
$ diff cat_pieces_on_grid.tex solved_cat.tex
$ diff goose_pieces_on_grid.tex solved_goose.tex


請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp







 

掃一掃在手機打開當前頁
  • 上一篇:代寫COMP10002、代做C++編程設(shè)計
  • 下一篇:代做ISYS1001、代寫C++,Java程序
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          国产偷久久久精品专区| 久久久久久久久久久久久女国产乱 | 国产美女精品免费电影| 亚洲一区精品在线| 国产一区成人| 欧美午夜不卡| 欧美www视频在线观看| 午夜精品一区二区三区在线播放| 亚洲激情在线| 一区二区在线不卡| 国产农村妇女毛片精品久久莱园子 | 久久免费视频一区| 欧美一区二区三区久久精品| 一区二区三区四区国产精品| 国产精品久久久久久久一区探花 | 亚洲欧美资源在线| 国产精品毛片大码女人| 免费人成网站在线观看欧美高清| 午夜亚洲性色视频| 亚洲一区二区3| 在线综合亚洲| av不卡在线看| 在线一区二区三区四区| 一本色道久久88综合日韩精品 | 久久国产精品久久精品国产| 一区二区冒白浆视频| 亚洲欧洲日韩综合二区| 在线观看日产精品| 尤物网精品视频| 在线欧美小视频| 在线看片欧美| 国产精品日日摸夜夜添夜夜av| 亚洲一区二区三区四区五区午夜| 亚洲激情欧美激情| 国产亚洲美州欧州综合国| 欧美亚洲第一页| 欧美性色视频在线| 国产精品美女视频网站| 国产精品福利网站| 国产精品腿扒开做爽爽爽挤奶网站| 欧美日韩不卡一区| 欧美午夜电影一区| 国产欧美日韩综合| 韩国av一区二区三区四区| 韩国亚洲精品| 亚洲人成人77777线观看| 亚洲精品永久免费| 亚洲香蕉网站| 久久久久88色偷偷免费| 老司机精品久久| 在线色欧美三级视频| 一本大道久久a久久精二百| 日韩系列欧美系列| 欧美顶级大胆免费视频| 欧美精品1区2区3区| 欧美日韩亚洲综合一区| 国产女主播一区二区三区| 国产一区二区三区免费不卡| 亚洲国产欧美日韩| 亚洲欧美国产va在线影院| 欧美在线综合| 欧美日韩99| 国产综合久久久久久鬼色| 91久久久久久| 欧美一级大片在线免费观看| 欧美自拍偷拍| 久久久青草婷婷精品综合日韩| 欧美va亚洲va国产综合| 国产精品萝li| 亚洲人妖在线| 亚洲精品乱码久久久久久久久 | 国产主播一区二区| 亚洲欧洲另类| 欧美一区二区三区视频在线| 欧美成人伊人久久综合网| 国产精品久久久久秋霞鲁丝| 亚洲欧洲在线观看| 久久久久久自在自线| 国产精品美女久久久久久久| 亚洲麻豆视频| 欧美 日韩 国产一区二区在线视频 | 国产精品国产福利国产秒拍| 亚洲国产精品视频| 午夜在线观看欧美| 欧美三级在线视频| 亚洲美女电影在线| 欧美成人一区二区| 亚洲欧洲精品一区二区精品久久久| 欧美一区三区二区在线观看| 国产精品久久夜| 亚洲一级在线| 国产精品老女人精品视频| 一区二区三区日韩精品| 欧美精品一区二区三区蜜臀| 亚洲国产欧美不卡在线观看| 久久字幕精品一区| 影音先锋中文字幕一区| 免费观看亚洲视频大全| 一区二区亚洲精品| 免费成人av资源网| 亚洲精品乱码久久久久久日本蜜臀 | 亚洲亚洲精品三区日韩精品在线视频| 欧美理论电影在线观看| 日韩一级黄色av| 欧美日韩国产综合久久| 夜夜爽夜夜爽精品视频| 欧美日韩午夜剧场| 亚洲影院色无极综合| 国产精品入口日韩视频大尺度| 午夜精品电影| 国产一二精品视频| 久久一区中文字幕| 亚洲精品国产精品国自产在线| 欧美精品七区| 亚洲综合色自拍一区| 国产一本一道久久香蕉| 老司机精品视频网站| 亚洲日本一区二区三区| 欧美性天天影院| 欧美一区二区在线免费播放| 在线免费观看欧美| 欧美日韩在线一区| 久久精品国产亚洲一区二区三区 | 亚洲国产专区校园欧美| 欧美日韩一区二区在线观看视频| 午夜视频在线观看一区二区三区| 国内精品伊人久久久久av一坑| 欧美福利视频在线| 亚洲欧美高清| 亚洲国产欧美一区二区三区同亚洲 | 欧美日韩国产成人精品| 亚洲欧美日韩国产综合精品二区| 狠狠综合久久av一区二区小说| 欧美mv日韩mv国产网站| 亚洲永久在线| 最新高清无码专区| 国产视频在线观看一区| 欧美激情精品久久久久久蜜臀| 亚洲综合好骚| 亚洲麻豆一区| 精品成人在线| 国产精品主播| 欧美日本三级| 国产女优一区| 国产日韩欧美精品一区| 国产精品国产三级国产a| 午夜精品免费视频| 亚洲人成在线播放| 国产一区二区精品在线观看| 欧美日韩成人在线播放| 久久深夜福利免费观看| 亚洲欧美自拍偷拍| 在线午夜精品自拍| 亚洲人成7777| 亚洲电影av在线| 国产午夜久久久久| 国产精品www色诱视频| 欧美国产精品专区| 免费欧美电影| 久久综合九色欧美综合狠狠| 欧美在线3区| 欧美一级欧美一级在线播放| 亚洲香蕉成视频在线观看| 中文av一区特黄| 一区二区免费在线视频| 亚洲卡通欧美制服中文| 最新亚洲一区| 亚洲激情影视| 亚洲麻豆国产自偷在线| 日韩午夜黄色| 亚洲色图综合久久| 亚洲视频1区2区| 亚洲欧美日韩精品一区二区| 亚洲一区日韩| 欧美在线视频观看免费网站| 欧美一区亚洲一区| 欧美中文在线观看| 久久精品国产一区二区三区| 久久精品九九| 久久阴道视频| 欧美国产视频日韩| 欧美另类综合| 国产精品高潮呻吟久久| 国产精品综合网站| 黄色资源网久久资源365| 激情综合网激情| 国产视频丨精品|在线观看| 尹人成人综合网| 亚洲综合视频网| 欧美中文字幕在线视频| 久久在线视频在线| 欧美精品综合| 国产精品色网| 今天的高清视频免费播放成人| 亚洲高清在线精品| 一区二区电影免费观看| 欧美亚洲免费| 欧美ab在线视频| 国产精品色婷婷| 亚洲国产成人在线|