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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

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

時間:2025-04-28  來源:合肥網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++編程設計
  • 下一篇:代做ISYS1001、代寫C++,Java程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

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

          9000px;">

                丰满饥渴老女人hd| 久久久久久久久久一区二区三区| 亚洲精品视频三区| 亚洲高清av一区二区三区| 在线观看日本www| 中文字幕人妻一区二区| 亚洲国产视频一区二区三区| 亚洲午夜久久久久久久国产| 91激情视频在线观看| www.黄色一片| 国产美女高潮视频| 精品久久久久久久久久久久久久久久久久 | 男人天堂av电影| 88av在线播放| 丁香六月婷婷综合| 国产一级在线视频| 蜜臀av午夜精品久久| 欧美亚洲日本在线| 午夜一区二区三区免费| 中文字幕在线观看91| 97超碰中文字幕| 国产亚洲欧美精品久久久www| 精品人妻无码一区二区性色| 欧洲一级黄色片| 午夜精品一区二区三级视频| 亚洲精品手机在线观看| 丰满少妇一级片| 久久精品五月天| 婷婷在线观看视频| 69av.com| 加勒比一区二区| 神马久久精品综合| 亚洲天堂一级片| 国产性猛交╳xxx乱大交| 欧美偷拍第一页| 中文国产在线观看| 成人爽a毛片一区二区| 久久久综合久久久| 一区二区成人网| 国产 日韩 欧美 在线| 男女做暖暖视频| 中文字幕 国产精品| 国产成人在线综合| 青青草精品在线| 亚洲一区 视频| 久久国产免费观看| 伊人网av在线| 国产精品中文久久久久久| 日本精品久久久久中文| 亚洲少妇中文字幕| 久久精品国产亚洲av麻豆| 香蕉网在线视频| 国产成人精品亚洲精品色欲| 人妻熟人中文字幕一区二区| 亚洲天堂男人网| 老熟妇高潮一区二区高清视频| 永久看片925tv| 国产露脸国语对白在线| 手机看片一区二区| 成人午夜视频一区二区播放| 日韩av.com| 啊啊啊国产视频| 日韩欧美视频免费观看| www.国产一区二区| 日韩美女黄色片| 国产jk精品白丝av在线观看 | 国产精品成人免费一区二区视频 | 狠狠干狠狠操视频| 一女二男3p波多野结衣| 国内精品久久久久久久久久| 在线观看亚洲黄色| 久久国产乱子伦精品| 亚洲免费av一区| 欧美丝袜在线观看| 成人欧美精品一区二区| 熟妇女人妻丰满少妇中文字幕| 国产第一页精品| 在线观看成人动漫| 黄色一级免费视频| 在线观看日本中文字幕| 国产精品嫩草影视| 无码人妻久久一区二区三区| 国内av一区二区| 亚洲黄色片视频| 日本中文字幕在线观看视频| 国产99视频在线| 在线免费播放av| 麻豆亚洲av熟女国产一区二| japanese国产| 日本不卡一区二区在线观看| 国产精品免费在线视频| 天天爽夜夜爽视频| 久久精品国产成人av| 亚洲熟妇一区二区三区| 日韩高清免费av| 亚洲乱妇老熟女爽到高潮的片| 欧美成人精品网站| 99久久婷婷国产综合| 羞羞的视频在线| 久久免费视频99| 成年人在线观看av| 中文字幕久久熟女蜜桃| 刘亦菲久久免费一区二区| www国产一区| 一级做a爰片久久毛片16| 欧美一级特黄aaaaaa| 国产精品久久a| 91福利视频免费观看| 天天摸天天干天天操| 看欧美ab黄色大片视频免费| 成人公开免费视频| 亚洲天堂av中文字幕| 日韩免费不卡视频| 久一区二区三区| 国产精品白丝喷水在线观看| 亚洲精品人妻无码| 天天综合网久久综合网| 免费黄色在线网址| 国产一区二区三区四区五区六区| 波多野结衣国产| 中文字幕在线日本| 一区二区视频免费| 日本黄大片一区二区三区| 久久久久黄色片| 国产精品毛片一区二区在线看舒淇| 国产精品一区二区入口九绯色 | 99在线精品视频免费观看20| 久久影视中文字幕| 中文字幕乱码人妻无码久久| 成人免费看片98欧美| 欧日韩在线视频| 91中文字幕永久在线| 欧洲av一区二区三区| 国产午夜手机精彩视频| 性xxxfllreexxx少妇| 69视频免费在线观看| 欧美一级一区二区三区| 久久无码人妻一区二区三区| 国产美女免费无遮挡| 国产免费av电影| 国产成人免费看| 干b视频在线观看| www.激情五月| 国产成人三级在线观看视频| 99热这里只有精品66| 成人精品一二三区| 中文字幕人妻熟女人妻a片| 午夜一级免费视频| 性高潮久久久久久久| 天堂在线视频免费| 午夜精品一二三区| 五月天婷婷影视| 五月综合色婷婷| 一区二区伦理片| 亚洲va在线观看| 又色又爽又黄视频| 在线观看中文av| 亚洲精品国产精品乱码不卡| 亚洲乱码在线观看| 亚洲国产欧美日韩在线| 亚洲精品91在线| 伊人成年综合网| 中文字幕人妻互换av久久| 天天摸天天碰天天爽天天弄| 日韩毛片在线播放| 无码人妻aⅴ一区二区三区| 超碰中文字幕在线观看| xxxx国产精品| 天天操天天干天天操| 99久久精品免费看国产交换| 国产精品国产三级国产aⅴ| 青娱乐国产盛宴| 西西444www无码大胆| 熟女高潮一区二区三区| 天天操天天干天天干| 制服.丝袜.亚洲.中文.综合懂 | 国产av精国产传媒| xxxx国产精品| 91精品国产三级| 福利网址在线观看| 国产午夜久久久| 麻豆精品国产传媒av| 天天干天天草天天| 婷婷激情5月天| 中文字幕日本人妻久久久免费| 午夜福利123| 亚洲欧美另类日本| 岛国av免费在线| 精品少妇爆乳无码av无码专区| 日韩美一区二区| 一区二区三区精彩视频| 91精品人妻一区二区三区四区| 999福利视频| 九九热精品视频在线| 日本中文字幕第一页| 中文字幕一区二区三区四区免费看 | 日韩一区二区三区不卡视频| 中文字幕乱码在线人视频| 69视频在线观看免费| 亚洲精品视频三区|