Python代做编程辅导:COMP9021 Tangram

用Python解一个Tangram,也就是七巧板问题,作业给基本框架,往里面填写逻辑即可。

The assignment consists of three parts, from easiest to more difficult. Each part is worth 3 marks.

由LE PHUONG撰写

For each test, the automarking script will let your program run for 30 seconds.
As all output is True or False, each test will actually consist of a number of subtests of similar difficulty, and passing one test will mean passing all associated subtests; failing at least one of the subtests of a test will result in scoring 0 to that test.

×

现在提到了代写服务,肯定很多人都不会觉得陌生,就算是国内也是有着专业代写作业的服务行业的,能够为有需求的学生提供很多的帮助,不过其实代写机构在国外会更获得学生的支持,这是因为国外的学校对于平时的作业要求比较严格,为了获得更高的分数顺利毕业,不少留学生就会让代写机构帮忙完成作业,比较常见的作业代写类型,就是计算机专业了,因为对于留学生来说这个技术对于Machine Learning或者AI的代码编程要求更高,所以找代写机构完成作业会简单轻松很多,那么代写机构的水平,要怎么选择才会比较高?

1、代写机构正规专业

不论是在什么情况下,选择正规合法经营的机构肯定是首要的操作,这也是为了避免自己在找机构的时候,出现上当受骗的现象,造成自己的经济出现损失,带来的影响还是非常大的,所以需要注意很多细节才可以,所以在这样的情况下,代写机构的选择,也要选择在经营方面属于正规合法的类型,这样才可以保证服务进行的时候,不会出现各种问题,也可以减少损失的出现,而且正规合法也是代写机构的合格基础。

2、代写机构编程能力

作业的难度相信很多人都很熟悉,特别是对于AI深度学习或者是人工神经网络这种算法来说,因为要对SVM、Design Tree、线性回归以及编程有很高的要求,可以说作业的完成要求非常高,因此才会带动代写机构的发展,找专业的代写机构,一般都是会有专业的人员帮忙进行作业的完成,因为这类型的作业对专业要求比较高,因此代写机构也要具备专业能力才可以,否则很容易导致作业的完成出现问题,出现低分的评价。

3、代写机构收费情况

现在有非常多的留学生,都很在意作业的完成度,为了保证作业可以顺利的被完成,要进行的相关操作可是非常多的,代写机构也是因为如此才会延伸出来的,在现在发展也很迅速,现在选择代写机构的时候,一定要重视收费情况的合理性,因为代写作业还是比较费精力的,而且对于专业能力要求也高,所以价格方面一般会收取几千元至万元左右的价格,但是比较简单的也只需要几百元价格。

4、代写机构完成速度

大部分人都很在意代写机构的专业能力,也会很关心要具备什么能力,才可以展现出稳定的代写能力,其实专业的代写机构,对于作业完成度、作业完成时间、作业专业性等方面,都是要有一定的能力的,特别是在完成的时间上,一定要做到可以根据客户规定的时间内完成的操作,才可以作为合格专业的代写机构存在,大众在选择的时候,也可以重视完成时间这一点来。

现在找专业的CS代写机构帮忙完成作业的代写,完全不是奇怪的事情了,而且专业性越强的作业,需要代写机构帮忙的几率就会越高,代写就发展很好,需求量还是非常高的,这也可以很好的说明了,这个专业的难度以及专业性要求,才可以增加代写机构的存在。



Up to one mark will reward good comments, good choice of names for identifiers and functions, readability of code, simplicity of statements, compactness of functions. This will be determined manually.

One extra mark will be awarded for making available to the class a good test case, consisting of two similar sets of pieces and two solved tangrams built from such a set, which can then be used by everyone for testing purposes.
Late assignments will be penalised: the mark for a late submission will be the minimum of the awarded mark and 10 minus the number of full and partial days that have elapsed from the due date.

Background

The game of tangram consists in creating shapes out of pieces. We assume that each piece has its own colour, different to the colour of any other piece in the set we are working with. Just for reference, here is the list the colours that are available to us

Pieces

Here is an example of the contents of the file pieces A.xml, typical of the contents of any file of this kind (so only the number of pieces, the colour names, and the various coordinates can differ from one such file to another – we do not bother with allowing for variations, in the use of space in particular).



<svg version ="1.1" xmlns ="http://www.w3.org/2000/svg">
  <path d="M 50 50 L 50 90 L 90 90 z" fill="red" />
  <path d="M 160 170 L 160 130 L 120 130 z" fill="green" />
  <path d="M 200 30 L 180 30 L 180 50 L 220 50 z" fill="blue" />
  <path d="M 40 100 L 40 140 L 60 140 L 60 120 z" fill="yellow" />
  <path d="M 210 70 L 230 90 L 270 90 L 270 50 L 230 50 z" fill="purple" />
  <path d="M 180 130 L 180 170 L 220 210 L 240 190 z" fill="olive" />
  <path d="M 100 200 L 120 180 L 80 140 L 80 180 z" fill="magenta" />
</svg>

python岭回归、Lasso、随机森林、XGBoost、Keras神经网络、kmeans聚类链家租房数据地理可视化分析

阅读文章


Note that the coordinates are nonnegative integers. This means that the sets of pieces we consider rule out those of the traditional game of tangram, where 2 is involved everywhere…


随时关注您喜欢的主题


We require every piece to be a convex polygon. An .xml file should represent a piece with n sides (n > 3) by an enumeration of n pairs of coordinates, those of consecutive vertices, the first vertex being arbitrary, and the enumeration being either clockwise or anticlockwise.
The pieces can have a different orientation and be flipped over. For instance, the file pieces_AA.xml whose contents is


<svg version ="1.1" xmlns ="http://www.w3.org/2000/svg"> <path d="M 50 50 L 50 90 L 90 90 z" fill="red" /> <path d="M 160 170 L 160 130 L 120 130 z" fill="green" /> <path d="M 200 30 L 180 30 L 180 50 L 220 50 z" fill="blue" /> <path d="M 40 100 L 40 140 L 60 140 L 60 120 z" fill="yellow" /> <path d="M 210 70 L 230 90 L 270 90 L 270 50 L 230 50 z" fill="purple" /> <path d="M 180 130 L 180 170 L 220 210 L 240 190 z" fill="olive" /> <path d="M 100 200 L 120 180 L 80 140 L 80 180 z" fill="magenta" /> </svg>

Shapes

A representation of a shape is provided thanks to an .xml file with the same structure, storing the coordinates of the vertices of just one polygon.
The file shape_A_1.xml whose contents is

<svg version ="1.1" xmlns ="http://www.w3.org/2000/svg">
  <path d="M 30 20 L 110 20 L 110 120 L 30 120 z" fill="grey" />
</svg>

Contrary to pieces, shapes are not assumed to be convex polygons. Still they are assumed to be simple polygons (the boundary of a simple polygon does not cross itself; in particular, it cannot consist of at least 2 polygons that are connected by letting two of them just “touch” each other at one of their vertices – e.g., two rectangles such that the upper right corner of one rectangle is the lower left corner of the other rectangle; that is not allowed).
Whereas you will have to check that the representation of the pieces in an .xml file satisfies our constraints,
you will not have to do so for the representation of a shape; you can assume that any shape we will be dealing with satisfies our constraints.

First Task

You have to check that the pieces represented in an .xml file satisfy our constraints. So you have to check that each piece is convex, and if it represents a polygon with n sides (n > 3) then the representation consists of an enumeration of the n vertices, either clockwise or anticlockwise. Here is the expected behaviour of your program.

Second Task

You have to check whether the sets of pieces represented in two .xml files are identical, allowing for pieces to be flipped over and allowing for different orientations. Here is the expected behaviour of your program.

Third Task

You have to check whether the pieces represented in an .xml file are a solution to a tangram puzzle represented in another .xml file. Here is the expected behaviour of your program.


关于分析师

在此对LE PHUONG对本文所作的贡献表示诚挚感谢,她在山东大学完成了计算机科学与技术专业的硕士学位,专注数据分析、数据可视化、数据采集等。擅长Python、SQL、C/C++、HTML、CSS、VSCode、Linux、Jupyter Notebook。

 
QQ在线咨询
售前咨询热线
15121130882
售后咨询热线
0571-63341498

关注有关新文章的微信公众号


永远不要错过任何见解。当新文章发表时,我们会通过微信公众号向您推送。

技术干货

最新洞察

This will close in 0 seconds