Python代写 | COMP9021, Trimester 2, 2020

本次Python代写是完成检测文本编码的程序

COMP9021, Trimester 2, 2020

1. General presentation
You will design and implement a program that will
• check whether some numbers, stored in a file, represent a particular coding of a frieze, and
• – either display the period of the pattern of the frieze and the transformations that keep it invariant,
based on a result that classifies friezes into 7 groups of symmetries,
– or output some Latex code in a file, from which a pictorial representation of the frieze can be
produced.
The representation of a frieze is based on a coding with numbers in the range 0 …15, each such number n being
associated with a particular point p such that
• if the rightmost digit of the representation of n in base 2 is equal to 1 then p is to be connected to its
northern neighbour:
• if the second rightmost digit of the representation of n in base 2 is equal to 1 then p is to be connected
to its north-eastern neighbour:
• if the third rightmost digit of the representation of n in base 2 is equal to 1 then p is to be connected
to its eastern neighbour:
• if the fourth rightmost digit of the representation of n in base 2 is equal to 1 then p is to be connected
to its south-eastern neighbour:
3. Examples
3.1. First example. The file frieze_1.txt has the following contents.
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0
0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0
0 0 0 0 4 4 1 5 4 4 4 4 8 0 0 0 0 0 0 4 4 1 5 4 4 4 4 8 0 0 0
0 0 0 2 0 0 5 1 0 0 0 0 0 8 0 0 0 0 2 0 0 5 1 0 0 0 0 0 8 0 0
0 0 2 0 0 0 0 0 0 0 0 0 0 0 8 0 0 2 0 0 0 0 0 0 0 0 0 0 0 8 0
0 6 4 4 4 4 4 4 4 4 4 4 4 4 4 0 6 4 4 4 4 4 4 4 4 4 4 4 4 4 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 4 4 4 12 4 4 4 1 1 0 0 0 0 0 0 4 4 4 12 4 4 4 1
1 1 0 4 4 0 0 0 1 2 0 0 8 1 0 1 1 0 4 4 0 0 0 1 2 0 0 8 1 0 1
1 1 0 5 5 1 0 0 3 0 0 0 0 1 0 1 1 0 5 5 1 0 0 3 0 0 0 0 1 0 1
1 1 0 5 5 1 0 0 5 4 4 4 4 1 0 1 1 0 5 5 1 0 0 5 4 4 4 4 1 0 1
1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1
1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1
1 5 4 5 4 5 4 4 4 4 4 4 4 4 4 1 5 4 5 4 5 4 4 4 4 4 4 4 4 4 1
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_1.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 15 that is invariant under translation only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_1.tex that can be given as
argument to pdflatex to produce a file named frieze_1.pdf that views as follows.
3
3.2. Second example. The file frieze_2.txt has the following contents.
4 4 4 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 4 4 4 4 12 4 0
0 0 0 4 8 0 0 0 3 1 1 1 0 0 0 4 8 0 0 0 3 1 1 1 0 0 0 4 8 0 0 0 3 1 1 1 0 0 0 4 8 0 0 0 3 1 1 1 0
0 0 2 0 0 0 0 0 0 1 1 0 0 0 2 0 0 0 0 0 0 1 1 0 0 0 2 0 0 0 0 0 0 1 1 0 0 0 2 0 0 0 0 0 0 1 1 0 0
1 0 9 0 0 1 0 1 0 1 1 0 1 0 9 0 0 1 0 1 0 1 1 0 1 0 9 0 0 1 0 1 0 1 1 0 1 0 9 0 0 1 0 1 0 1 1 0 1
4 0 0 4 2 0 4 4 8 1 1 4 4 0 0 4 2 0 4 4 8 1 1 4 4 0 0 4 2 0 4 4 8 1 1 4 4 0 0 4 2 0 4 4 8 1 1 4 0
8 1 0 0 0 0 1 0 0 1 3 0 8 1 0 0 0 0 1 0 0 1 3 0 8 1 0 0 0 0 1 0 0 1 3 0 8 1 0 0 0 0 1 0 0 1 3 0 0
1 1 0 4 0 0 3 1 0 0 0 0 1 1 0 4 0 0 3 1 0 0 0 0 1 1 0 4 0 0 3 1 0 0 0 0 1 1 0 4 0 0 3 1 0 0 0 0 1
1 0 0 5 1 0 0 1 0 4 0 0 1 0 0 5 1 0 0 1 0 4 0 0 1 0 0 5 1 0 0 1 0 4 0 0 1 0 0 5 1 0 0 1 0 4 0 0 1
1 4 4 0 4 4 8 1 0 1 1 0 1 4 4 0 4 4 8 1 0 1 1 0 1 4 4 0 4 4 8 1 0 1 1 0 1 4 4 0 4 4 8 1 0 1 1 0 1
3 0 8 1 1 0 0 1 0 1 1 0 3 0 8 1 1 0 0 1 0 1 1 0 3 0 8 1 1 0 0 1 0 1 1 0 3 0 8 1 1 0 0 1 0 1 1 0 1
0 0 1 1 3 1 0 0 4 1 5 0 0 0 1 1 3 1 0 0 4 1 5 0 0 0 1 1 3 1 0 0 4 1 5 0 0 0 1 1 3 1 0 0 4 1 5 0 0
0 0 1 0 8 1 0 0 1 0 0 1 0 0 1 0 8 1 0 0 1 0 0 1 0 0 1 0 8 1 0 0 1 0 0 1 0 0 1 0 8 1 0 0 1 0 0 1 0
4 4 7 5 5 5 4 4 5 4 4 5 4 4 7 5 5 5 4 4 5 4 4 5 4 4 7 5 5 5 4 4 5 4 4 5 4 4 7 5 5 5 4 4 5 4 4 5 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_2.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 12 that is invariant under translation
and vertical reflection only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_2.tex that can be given as
argument to pdflatex to produce a file named frieze_2.pdf that views as follows.
4
3.3. Third example. The file frieze_3.txt has the following contents.
12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 12 4 12 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 0
1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1
6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 6 4 6 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_3.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 3 that is invariant under translation
and horizontal reflection only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_3.tex that can be given as
argument to pdflatex to produce a file named frieze_3.pdf that views as follows.
5
3.4. Fourth example. The file frieze_4.txt has the following contents.
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0
0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0
4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 0
5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 1
0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0
0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0
4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 4 4 1 4 0 5 0
5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 5 4 0 5 1 4 1
0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0 4 1 0
4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 4 5 4 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_4.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 6 that is invariant under translation
and glided horizontal reflection only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_4.tex that can be given as
argument to pdflatex to produce a file named frieze_4.pdf that views as follows.
6
3.5. Fifth example. The file frieze_5.txt has the following contents.
4 4 4 4 4 4 12 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 12 4 4 4 4 4 4 4 12 4 0
0 4 1 0 0 2 0 8 0 4 1 0 0 2 0 8 0 4 1 0 0 2 0 8 0 4 1 0 0 2 0 8 0 4 1 0 0 2 0 8 0 4 1 0 0 2 0 8 0
10 0 0 0 2 0 0 0 10 0 0 0 2 0 0 0 10 0 0 0 2 0 0 0 10 0 0 0 2 0 0 0 10 0 0 0 2 0 0 0 10 0 0 0 2 0 0 0 0
0 8 0 2 0 0 4 2 0 8 0 2 0 0 4 2 0 8 0 2 0 0 4 2 0 8 0 2 0 0 4 2 0 8 0 2 0 0 4 2 0 8 0 2 0 0 4 2 0
4 4 6 4 4 4 5 4 4 4 6 4 4 4 5 4 4 4 6 4 4 4 5 4 4 4 6 4 4 4 5 4 4 4 6 4 4 4 5 4 4 4 6 4 4 4 5 4 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_5.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 8 that is invariant under translation
and rotation only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_5.tex that can be given as
argument to pdflatex to produce a file named frieze_5.pdf that views as follows.
7
3.6. Sixth example. The file frieze_6.txt has the following contents.
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0
4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 4 0 4 4 0
0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0 1 1 4 0
1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1 5 1 1 1
5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 5 4 4 1 1
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_6.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 4 that is invariant under translation,
glided horizontal and vertical reflections, and rotation only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_6.tex that can be given as
argument to pdflatex to produce a file named frieze_6.pdf that views as follows.
8
3.7. Seventh example. The file frieze_7.txt has the following contents.
4 4 12 4 4 4 12 4 4 4 12 4 4 4 12 4 4 4 12 4 4 4 12 4 0
0 2 0 8 0 2 0 8 0 2 0 8 0 2 0 8 0 2 0 8 0 2 0 8 0
10 0 8 0 10 0 8 0 10 0 8 0 10 0 8 0 10 0 8 0 10 0 8 0 0
0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 9 0 9 0 9 0 9 0 9 0 9 0 9 0 9 0 9 0 9 0 9 0 9 0
10 0 2 0 10 0 2 0 10 0 2 0 10 0 2 0 10 0 2 0 10 0 2 0 0
0 8 0 2 0 8 0 2 0 8 0 2 0 8 0 2 0 8 0 2 0 8 0 2 0
4 4 6 4 4 4 6 4 4 4 6 4 4 4 6 4 4 4 6 4 4 4 6 4 0
Here is a possible interaction:
$ python3

>>> from frieze import *
>>> frieze = Frieze(‘frieze_7.txt’)
>>> frieze.analyse()
Pattern is a frieze of period 4 that is invariant under translation,
horizontal and vertical reflections, and rotation only.
>>> frieze.display()
The effect of executing frieze.display() is to produce a file named frieze_7.tex that can be given as
argument to pdflatex to produce a file named frieze_7.pdf that views as follows.


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论