,,。
General presentation
You will design and implement a program that will
- extract and analyse the various characteristics of (simple) polygons, their contours being coded and stored in a file, and
- either display those characteristics: perimeter, area, convexity, number of rotations that keep the polygon invariant, and depth (the length of the longest chain of enclosing polygons)
- or output some Latex code, to be stored in a file, from which a pictorial representation of the polygons can be produced, coloured in a way which is proportional to their area.
Call encoding any 2-dimensional grid of size between between 2 2 and 50 50 (both dimensions can be dierent) all of whose elements are either 0 or 1.
Call neighbour of a member m of an encoding any of the at most eight members of the grid whose value is 1 and each of both indexes diers from m’s corresponding index by at most 1. Given a particular encoding, we inductively define for all natural numbers d the set of polygons of depth d (for this encoding) as follows. Let a natural number d be given, and suppose that for all d0 lt; d
, the set of polygons of depth d0 has been defined. Change in the encoding all 1’s that determine those polygons to 0. Then the set of polygons of depth d is defined as the set of polygons which can be obtained from that encoding by connecting 1’s with some of their neighbours in such a way that we obtain a maximal polygon (that is, a polygon which is not included in any other polygon obtained from that encoding by connecting 1’s with some of their neighbours).
Submission
Your programs will be stored in a file named polygons.py. After you have developed and tested your program, upload your files using Ed. Assignments can be submitted more than once: the last version is marked.
Assessment
The assignment is worth 10 marks. the automarking script will allocate 30 seconds to each run of your program.
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.
The outputs of your programs should be exactly as indicated.
Examples
First example
Given a file named polys_1.txt whose contents is
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111
your program when run as pytㅨㅯの〳ㄠㅰㅯㅬㅹㅧㅯㅮㅳㄮㅰべഠਦのㅤㅡㅳㅨㄻㅦㅩㅬㅥㄠㅰㅯぬべㅳㅟㄱㄮㅴㅸㅴㄠㅳㅨㅯㅵㅬㅤㄠㅯㅵㅴㅰㅵぴ〼ㄯㅰㄾㄍㄊㄼㅰㅲㅥㄾㄼㅣは〾ㅐㅯㅬㅹㅧㅯㅮㄠㄱㄺㄍㄊㄠ〠〠ㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄷㄸㄮㄴㄍㄊ〠〠ㄠㄠㅁㅲㅥㅡㄺㄠㄳㄸㄴㄮㄱ〶ਊ〠ㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺㄠㅹㅥㅳ」《ㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩちのㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠㄴ」ഊਠ〠ㄠㄠㅄㅥㅰㅴㅨㄺㄠㄍㄊㅐㅯㅬべでㅯㅮㄠㄲㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲどねㅥㅴㅥㅲㄺㄠㄷㄵㄮㄲㄍㄊㄠㄠㄠ〠ുੲづㅡㄺㄠㄳㄵㄳㄮㄴㄴㄍㄊㄠㄠㄠㄠㅃはのㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠ〠〠ㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠひ൯ੴちㅴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥㅰぴとㄺㄠㄱㄍㄊㅐㅯㅬㅹㅧはのㄠㄳㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥひഺਠ〷ㄲㄮㄍㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠㄳㄲㄴ〮〰ㄍㄊㄠㄠㄠㄠㅃはのㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠㅯてഠ੩のㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠ〴」ㄊㄠㄠㄠㄠㅄづばㅴㅨㄺㄠㄲㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄴㄺㄍㄊ〠ഠਠ〠ㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄶㄸㄮㄸㄍㄊㄠㄠㄠ〠ぁㅲㅥㅡㄺ〠〲ㄹㄵㄮㄸㄴㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺㄠㅹづ൳《ㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠどㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲはぴㅡㅴどはㅮㅳㄺㄠㄴㄍㄊㄠㄠㄠ〠ㅄㅥㅰㅴㅨㄺㄠㄳㄍㄊぐ൯੬べㅧㅯㅮㄠㄵㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥひ〺ㄠㄶㄵㄮ〶」ㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠㄲㄶㄸㄮㄹㄶㄍㄊㄠ〠ഠਠぃㅯㅮㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠはてㄠㅩㅮㅶㅡㅲどちㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠㄠ〠ഠづㅰㅴㅨㄺㄠㄴㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄶㄺ」《ㄠㄠㄠㄠㅐㅥㅲㅩねづㅴㅥㅲㄺㄠㄶㄲㄮㄴㄍㄊㄠㄠㄠㄠㅁㅲㅥちഺਠ〲ㄴㄳㄮㄳㄶㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸ〺〠ㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎぢ〠ㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡぴ൩੯のㅳㄺㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥㅰㅴㅨㄺ〠〵ㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄷㄺ」《ㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄵ〹മਲ」ㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠㄲㄱㄹㄮ〰〴ㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺㄠべづㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠㅩㅮぶൡੲどㅡㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺ〠〴ㄍㄊㄠㄠㄠㄠㅄㅥㅰㅴㅨㄺㄠㄶㄍㄊぐはㅬㅹㅧㅯㅮㄠㄸㄺㄍㄊㄠㄠㄠㄠぐੲどㅭㅥㅴㅥㅲㄺㄠㄵㄶㄮㄍㄊ〠〠ㄠㄠㅁㅲㅥㅡㄺㄠㄱㄹㄶㄮㄍㄊㄠㄠ〠〠ㅃㅯㅮㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊ〠ഠਠ〠ㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩちのㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠㄠㄠㄠいづㅰㅴㅨㄺㄠㄷㄍㄊㅐㅯㅬㅹで൯੮〠ㄹㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲどねㅥㅴㅥㅲㄺㄠㄵㄲㄮㄸㄍㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠ〱〷ㄴㄮㄲㄴㄍㄊㄠㄠㄠㄠㅃは൮੶づㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠ〠〠ㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮび〺ㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥば൴੨〺ㄠㄸㄍㄊㅐㅯㅬㅹㅧはのㄠㄱㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄴㄹㄮㄶㄍ《〠ㄠㄠㄠㅁㅲㅥㅡㄺㄠ〱വਲ਼〮ㄷㄶㄍㄊㄠㄠㄠㄠぃはㅮㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡのぴㄠㅲㅯㅴㅡㅴㅩㅯの൳〠ㄴㄍㄊㄠㄠㄠㄠいづㅰㅴㅨㄺㄠㄹㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄱㄱㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭづぴㅥㅲㄺㄠㄴㄶㄮ〴ਊ〠ㄠㄠㄠㅁㅲㅥち〺ㄠㄱㄳㄴㄮㄵㄶㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢ〠はㅦㄠㅩㅮㅶㅡひ൩のㅴㄠㅲㅯㅴちぴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥㅰㅴㅨㄺㄠㄱㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄱㄲ〺」ㄊㄠㄠㄠㄠぐੲどㅭㅥㅴㅥひ〺ㄠㄴㄳㄮㄲㄍㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠㄱㄱㄶㄮㄶㄴㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺ〠べㅥㅳㄍㄊ〠ഠਠ〠ㅎㅢㄠはてㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥㅰㅴㅨㄺㄠㄱㄱ」《ㅐㅯㅬべ൧੯のㄠㄱ〳〺ㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄴㄮㄍㄊㄠㄠㄠㄠㅁㅲㅥㅡㄺㄠㄱㄮㄍ《〠ㄠㄠ〠ൃ੯のㅶづへㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡㅴㅩㅯㅮㅳㄺㄠㄴㄍㄊㄠ〠〠ㄠいੰぴと〺ㄠㄱㄲㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄱㄴㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠㄳㄶㄮㄸㄍㄊㄠㄠㄠㄠㅁひづちഺਠ〸〴ㄮㄶㄴㄍㄊㄠㄠㄠㄠㅃㅯㅮㅶㅥㅸㄺㄠㅹㅥㅳㄍㄊㄠㄠㄠㄠㅎㅢㄠㅯㅦㄠㅩㅮㅶㅡㅲㅩㅡㅮㅴㄠㅲㅯㅴㅡぴど൯੮びㄺㄠㄴㄍㄊㄠㄠㄠㄠㅄㅥㅰㅴㅨㄺㄠㄱㄳㄍㄊㅐㅯㅬㅹㅧㅯㅮㄠㄱㄵㄺㄍㄊㄠㄠㄠㄠㅐㅥㅲㅩㅭㅥㅴㅥㅲㄺㄠ〳ളਮ〶」《〠〠〠〠ぁひづち〺〠〷〰〮〵〶」《〠〠〠〠ぃはのぶづへ〺〠べづび」《〠〠〠〠ぎぢ〠はて〠どのぶൡੲ㱩⽡㹯㱴⽡㹮൳㰠㸍†‱‱㌠†″☰㬠㈷⸶†㰍⼊㸠ഠਠ㱎㹦㰠㹲⁴ㅡ㩴൩੯›†㩰⁴㍨㜺⸠㘱‵⬍ 㥐㉯⩬⠠⸱㌷㈺⤍ഊਠ†††⁐䅥㩥⁴ㅥ㝲㘺⸠㘲㐷മਲ ††䌠㨺†മਲ‴ †† 㨠㉮൶䑴㩡⁴ど൯੮†㈠㨠ൄ⁰⁴›㩧ㅮ㜠⸱㘸›⬍ 㐠㈠⨠⡩㍥㉴⥥൲†′‴䄰㨠†㜠㍁㥥㉡ഺਠ″‶‰䌰㨠⁃›†⁹ †⁶㩴ㅴ൩੯›†䐴㨠†ㅄੰ ㍐㩯൬†㩐ㅲ㙩づ⁴⭥㌺㠠⨲⠊⸠㌠㈠⤠ുੲ›†䄲㨴㘊〠⸠㠠〠ൃ੯⁶⁸䌺㨊†ൎ††⁶㨠†ㄠൄ⁰⁴›䐠㩐㉬൹੧ 㐠㨠ഠਠ⁐㨮‶ㄍ㘊⸠〠†⬠⁁㑲づ⩡⠮⸳㌶㈍⤊ഠਠ††⁃䅮㨺†㙹㑥」《ഠਠ††⁎䌠㩶൮ੴ†⁴⁄㨊⁐ㅯ൬†䐲㨠†〠ഠ㔺㨠റ‴ 㨠‱ㄲ㐮⸹㐶⬊†㌠㐠⨠⡥㌺㈠⥹ੳ ††䄠㨠㑦㠠㥮㙶ൡੲ⁴䌠㩩ഠ ††⁄⁴㨊†ㄠഠਠ⁐䑭㨺†㌱റਮ⁁㙲㩥ൡ†‷‸㩮⁶ㅥ㙸⸺〠⁹⭥㐍《⨠⡢⸠㍯㉦⤠൩੮⁶䅡㩲㙴㑡どは൮ੳ›†‴䌊㩥⁰ഠਲ‱ ⁐⁹†㨺†ㄸമਰ ††䐠㩡›〠ഴਮ†㝃㩯൮੶⁸›†㩎ㄠ㉯㠠⭮⁶㍡ひ⩩⡲㍴㉡⥴൩੯›†䄴㨠†㌠㡄㑰ぴ൨†′′䌊㩯ഺ †††㨺†ㄱമ‴ †䐠㩮⁶㑥൸†㠠㨠ൎ††㨠ㅯ㑴㑴⭯㍳㘺⨠⠠⸠㌠㉄⥥൰ੴ›†′䄳㩯㕹ㅧ㡮㐠ലਵ› †䌠㩩൲†‱‶††‶㩶ㅸഺਠ⁹䐊㩎ㄠ൯੦㥮㩴ഠੲ⁴⁴㨠†ㄠㄠ⹄㉥⁰㈺㘠⨲⠯㍯㉤⥥ാ਼ ⁰䄾㩰‾㉡㥮ㄠ㉷൨†⁵䍮㩹⁴ളਠ⁰⁹⁰…㩥†ㅰ൯੬⁹ ‱䐮㩳㕯൵੬ㅥ〠㩳൯੭†⁵㩤†ㅩ㑮⸠㑡†⭦㍬㙥⨠⡤⸠㍰㉯⥬൹ੳ ‱⁴䅥㩷㕩ㅣ㠠㑣ൡ੮††䍧㩡൧ੵ⁴†㨠ㅩ൬†䑥㩬⁹ㅳൟㅴㄠ㩶൩⁷†㨮‼㤯㘾⬊‼㉨㈳⨠⡓㍣㉯⥮ਭ⁸䅰㨾⁓㉥ㅣㅮ㉤ഠ⁸⁰䍬㨾ാੇ⁶†㨠⁷ㅨ൯ੳ†䑮㩳†㙩൳਼ㅥ㈾㨼ൣ੯‾‰㨰‰㈰⸰㠰‰⬰‰㌰㈰⨰⠰⸰㌰㈰⤰രਰ‰‰‰‰䄰㨰‰㐰〰⸰㤰㘰രਰ ‰‱䌱㨱‱റ‱‱‱‱‱‱‱㨱‱ㄱറ‰ ‰䐰㨱‱㈱റ‱ㄱ㌱㨱റ‱‱‱‱㨱‱㠱⸱〱‱⬱‱ㄱ㠱⨱⠰⸰㌰㈱⤱റ‱‱‱‱䄱㨱‱ㄱ㐱⸱㐱〱റ‱‱‱‱䌱㨱‱റ‱‱‱‱‰‱㨱‱ㄱറ‱‱‱‱䐱㨱‱㜱റ‱ㄱ㐰㨰റਰ ‰‱㨱‱ㄱ㈱⸱㠱‱⬱‱㌱㈱⨱⠱⸱㌱㈱⤱റ‱‱‱‱䄱㨱‱㐱〰⸰㤱㘱ര ‰‱‱䌱㨱‱റ‱‱‱‱‱‱‱㨰‱ㄱറਰ ‰‱䐱㨱‱㈱റ‱ㄱ㔱㨱റ‱‱‱‱㨱‱㘱⸱㐱‰⬰‱ㄱ㐱⨱⠱⸱㌱㈱⤱രਰ‱‱‱‱䄱㨱‱㠱⸱㤱㘱റ‱‱‱‱䌱㨱‱റ‱‰‰‱‱‰㨱‱ㄱറ‱‱‱‱䐱㨱‱㠱റ‱ㄱ㘱㨱റਰ ‰‱㨱‱ㄱㄱ⸱㈱‱⬱‱㈱㠱⨱⠱⸱㌱㈱⤱റ‱‱‱‱䄱㨱‱㌱ㄱ⸱㌱㘱ര ‰‱‱䌱㨰‰റ‱‱‱‱‱‱‱㨱‱ㄱറਰ ‰‱䐱㨱‱㌱രਰ‱ㄱ㜱㨱റ‱‱‱‱㨰‰㐱⸱㠱‱⬱‱ㄱ〱⨱⠱⸱㌱㈱⤱റ‱‱‱‰䄰㨱‱㐱⸱㠱〱റ‱‱‱‱䌱㨱‱റ‱‱‱‱‱‱㨱‱ㄱറ‱‱‱‱䐱㨱‱㤠റਠ†㠠㨰ഠਰ†‰†‱㨰ㄊ⸠㈰†⬱†㈰㠠⨰⠠⸰㌠㈰⤠രਠ‱†‰†䄰㨰†㌱ㄠ⸰㌠㘰ഠ†‱†‱䌠㨠‱റਠ‰†‰†‰††㨰†ㄱഠਰ†‱†‰䐠㨰†㌰ഠ‱ㄠ㤰㨠രਠ‱†‰†㨠‰㌠⸱㈠‰⬠‰㘠⨰⠠⸰㌠㈰⤠രਠ‰†‱†䄰㨰†⸍㤊㈰ഠਰ†‰†‱䌠㨠‰രਠ‱†‰†‱††㨠‰ㄠറਠ‰†‰†䐱㨠‰ㄠ〰ഠਰ‰㈠〰㨍ഊਰ†‰†‰㨰†㤰⸠㘰†⬱†㈰㐠⨱⠠⸱㌠㈰⤠രਠ‱†‰†䄰㨰†㈰㌠⸱〠㐱ഠਰ†‱†‰䌠㨠‰രਠ‰†‰†‰‰㨰†ㄱഠ†‰†‰䐠㨰†㐱ഠਰ‱㈠㨠റਠ‱†‰†㨠‰ㄠ⸰㘠‰⬠‰㈠⨰⠠⸰㌍㈊⤱ഠ†‱†‱䄠㨠‱〠⸱㌠㈱ഠ†‱†‰䌠㨠‱രਠ‱†‰†‱††㨠‱ㄠറਠ‱†‱†䐱㨍 ㄱㄠറਠ†㈰㈠㨱ഠਰ†‰†‱㨱†㤰⸠㘱†⬰†㈰㐠⨰⠠⸰㌠㈱⤠റਠ‰†‰†䄰㨰†㈰㌠⸱〠㐰ഠ†‰†‱䌠㨍 ഠ†‰†‱†‰‰㨰†ㄱഠਰ†‰†‱䐠㨱†㐱ഠਰ‰㈠㌱㨠രਠ‱†‰†㨍 㠱⸠〱†⬰†㈰〠⨱⠠⸰㌠㈱⤠രਠ‱†‰†䄰㨱†ㄱ㘠⸰〠〱ഠਰ†‰†‰䌠㨠‱രਠ‰†‰†‰††㨱†ഠਰ†‱†‰䐠㨱†㔰ഠ‱㈠㐱㨠രਠ‰†‱†㨠‱㠠⸱〠‰⬠‰㈠〰⨠⠱⸠㌰㈠⤱ഠਰ†‱†‰䄠㨠‱ㄍ㘊⸱〠〱ഠਰ†‰†‱䌠㨠‱റਠ‰†‰†‱††㨠‰ㄠരਠ‰†‱†䐰㨠‱㔠രਠ†㈱㔍㨊റਠ‱†‰†㨠‱㘠⸰㐠‱⬠‰ㄠ㘰⨠⠱⸠㌰㈠⤰ഠ†‰†‰䄠㨠‰ㄠ〱⸠㈱㐠രਠ‰†‰†䌱㨰†ഠ†‰†‰† †㨠‱ㄠരਠ‰†‰†䐱㨠‱㘠രਠ†㈰㘠㨱ഠ†‰†‰㨰†㘱⸠㐱†⬱†㘠⨱⠍⸊㌱㈠⤱ഠਰ†‱†‰䄠㨠‱ㄠ〰⸠㈰㐠റਠ‰†‰†䌰㨰†ഠਰ†‰†‱†‱‱㨱†ഠ†‰†‱䐠㨠‱㘠റਠ†㈱㜠㨱ഠ†‱†‰㨰†㐱⸠㠰†⬰†㈠⨰⠠⸱㌠㈱⤠രਠ‰†‰†䄱㨱†㔱⸠㜱㘠റਠ‱†‱†䌱㨊‰രਠ‰†‰†‰††㨠‱ㄠറਠ‱†‱†䐰㨠‱㜠രਠ†㈰㠠㨰ഠਰ†‰†‰㨊‰㐠⸰㠠‰⬠‰ㄠ㈰⨠⠰⸠㌰㈠⤰ഠ†‰†‱䄠㨠‱㔠⸰㜠㘰ഠਰ†‰†‰䌠㨠‱രਠ‱†‰†‰††㨰†ഠ†‰†‰䐠㨰†㜰ഠ‰㈠㤱㨠റਠ‱†‱†㨠‱㌠⸰㈠‱⬠‰㠠⨰⠠⸰㌠㈰⤠രਠ‰†‰†䄱㨰†㈰⸍㔊㘰ഠਰ†‱†‰䌠㨠‰രਠ‱†‰†‰††㨠‱ㄠരਠ‰†‰†䐱㨠‰㠠രਠ†㌰〠㨰ਊ‰†‰†㨠‰㌠⸰㈠‰⬠‱㠠⨰⠠⸰㌠㈱⤠രਠ‰†‰†䄰㨰†㈰⸠㔰㘠റਠ‰†‱†䌰㨰†ഠਰ†‱†‰†‰†㨠‰ㄠരਠ‱†‰†䐰㨠‰㠠റਠ†㌰ㄠ㨰ഠ†‰†‱㨰†⸠㘰†⬰†㐱⨠⠱⸠㌰㈠⤰ਊ‰†‱†䄰㨰†〱⸠㘰㐠രਠ‰†‰†䌱㨱†ഠਰ†‱†‰†‰‱㨰†ഠਰ†‱†‰䐠㨱†㤰ਊ†㌱㈠㨰ഠਰ†‰†‰㨱†ㄱ⸠㘰†⬰†㐰⨠⠰⸠㌱㈠⤰ഠਰ†‰†‱䄠㨠‰〠⸱㘠㐰ഠਰ†‰†‰䌠㨠‰ര ‱†‰†‰‰㨰†ഠਰ†‰†‰䐠㨰†㤰ഠਰ‰㌠㌰㨠റਠ‰†‰†㨠‱ㄠ㜰⸠㘱⬊‰㐠㈱⨠⠰⸠㌰㈠⤰ഠਰ†‰†‰䄠㨠‱㜠㌱⸠㤱㈠റਠ‱†‱†䌱㨱†ഠ†‱†‱†‱‰㨰ㄊ഼ਯ䐾㩥‾ㄍഊ਼⁰㍲㑯㩧൲†⁷㨠⁰ㅹ㙴は⬳†㍰㡯⩬⡳⸮㍰㉹⤠ദ੮䄻㩥†㙰は㡹びൟਲ਼⁴⁸⁴䌠㩤†൰ੵ⁴‼ ⁰ 㨊†ㄠഠਠ⁐䑭㨺†㈲മ㍴㔨㨮ളਲ
†㨲ㄸ㐰⸍㐊†⬠†㌠㑃⩯⠺⸠㍮㉯⤍ഊਠ†††⁎䅢㨠㑮㡶㥲㙩ൡ੮⁴†䍴㩳›ഊਠ†††⁄⁴†㩐ㅲ൩੭⁴䐺㨲†㌫ഠ″㌲㘩㨍ഊਠ†††⁁㨲‸ㄍ㈊⸠㠠†⬠⁃㍯の⩶⡮㌍㈊⤠ഠਠ†⁎†䅯㩮⁶㍡㡲㑡の൴ਠ⁴䍴㨠′ഠਠ†⁄⁰›″㩲ㅭੴ›†䐲㨠‹㐪൳ੱ㌊㜠㨠ഠਠ⁁㨠†ㄠㅃ㉮⁶⭥⁸㈺㘠⩮⠠⸠㌠㉎⥢ഠ੯†䅶㩡㉴㤠ㅯ㉴ൡੴ䌺㨠†൰ੴ›†‰⁐⁹†㩥ㄺഠ‷‶†䐫㩳ⁱ㕲൴ਨ†㌠㠠㩁൲›†‵㨠⁃㥯㙶⭸›㈠㉮⩯⠠⸠㍎㉢⤠൯੦†⁶䅡㩮⁴㈠ㅲㅴ㉡൴੩›䌠㨠†൴੨›†‱†㩲›ㄠളਮ′††䐲㩲⁴㘨മਲ਼†㍁㥲㩥ൡ†‹‷㩮⁶㡥〺†⭮ㄍ㠊⨠⡢⸠㍯㉦⤠൩੮⁶䅡㩲ㅴ㑡㑩は൮ੳ›†‱䌊㩥⁰ഠਲ ⁐†㨲‷ㄮലਠ†‶䑳㨮″㜲ഩ㑡〺㨠വਮ‷‶ 㩸›㘠㑯⬊†ㄠ㐠⨠⡦⸠㍩㉮⥶ൡੲ⁴䄠㩡⁴㡩㥮㙳ഺਠ‱ †䌠㩴ਊ⁐⁹›㨸†ㄫഠ‴ⁱ䑲㨲
㠍ഊਠ›㐠ㄶ㨮ഷਲ ††㨠㑯⸍㠊†⬠†ㄠぎ⩢⡩㍶㉡⥲൩⁴†䅯㩩㑮㠺〠റ †††䌠㨺†੯⁹‸ 㨫†ㄱഴਪⁱ⁴䐨㨍 㤠ഠਠ‶㐮㈷㨲ਊ††††㩯㌊⸠㈠†⬠⁎㙢⨠⡮㍡㉲⥩ൡ੮⁴†䅴㩯ㅳ⸺㤠㈱ਊ††††䍄㨠‱൯੬⁹›†⁴㨠′ㄪ൳ੱ⁴
䐳㨠†ㄠ〠ുੲ′㐍㌊㨠ഠਠ†⁃㨊†ㄠ⸠㘠⁎⭢†㉯⩦⡡㍩㉡⥮൴ਠ⁴䅴㩳›〠⸱㌍㈊ഠਠ††⁄䍰㨍 ൹੧†‱†㨲ㅳ൱ੲ⁴
″䐲㨠†ㄠㅁ൲㱡⼺㸲㰍⼊㸠ൃ੯㱮㹥⁹†⁎㍲†☠㭴㉯›⁐‴ⁱ′ †‸㈠⹃ⱥ⁸ ††⁶⁴† ㉲⸊㰠⼠㸠ുੲ㱥㌺†㴸∰ⴠ∠㹮†㱩⽮㍡㹲൩㱮㸠䝲⁄㌰⸍ ‾㱤⼠㹨੮㰠㸠㱡㹴とㅮ″〠⁰はべはびば⁹〠ばㅩㅴ†ㄦㅤㅳㄻㅩㅥ†ㅰㅬ⁹ㅳ ㄳㅴ⁸ㅴ†ㅳㅯ⁵ㅬㄠ⁰ㅲㅤ⁵っ〠はづ†は⁵ぴ⁰ふ⁴〠ㅡ⁶づਠㅩ〠ㄠㅩづ†のねつ†ばぬ⁹ㅳ 〳ぴへ〠⁷とっ〠ちㄠㅥ†でぶの†ち〠ひふづㅴ†ぴ〠⁰つぬぴへ†ㅴㄠ⁰ひㅤ൵づ†ㅡ†てぬㄠちづ〠⁰はべㅟ″〮⁰つㄠ⁴ㅨぴ†ぶづ⁷ㅳ†ち〠ㅯぬぷ〮‼ㄯ⁰ㄾ《‼と′ㄠつ‽〢⁄づ⁴ちぬㅤつびㅲば൴੩はㄢ‾いぴどㅥ〠づっど⁰ㅴは〼 ㅨ′ㄾ《‼と″ㄠつ‽〢⁉の⁰ふ⁴ㄢ‾ぉば⁵ㅴ‼ㄯ〳‾」 ㄼ⁰〾⁔と〠の⁰ㅵ⁴〠び†づ⁸ㅰっ൴つ†ぴㄠはびㅳ⁴〠て†べどㄠどづㄠㅦ†へㅩ〠‰〦びⁱふ〻〠ㅮ〠†㰠⽹㹩൭ਠ㱡㸠ൡੴ†㱳㹥′ⁱ†ⱹ†Ɒ††㱡⽣㸠ൡ੮⁹⁷㱲㹯⁴⁉†⁸†⁹⁴‾※†ⰻ†※㱮⼠㹩൳ਠ⁴†㱥㹳䅳♩㭰⁵⁴‾‽‾⁰⸾⁰ⵧ⁵⁰ ‾⁴⁰䙳⁹ⱦ⁴ ㈾㔍┊‼ ⁰⁰⁴㉥㔾┍ ‾†⡦㝡㕭╥⁴⥥⸠†⁵⸠⁴†ⱹ†⁌‷Ᵽ† ‾⸠㕩⁴⬬†ㅴ㱡⽴㹳ബਠ㱤⽯㸠൮੯㱴㹳⁴†Ⱐ⁴⁵†⁴䱲††┠ ⁉ ‴⠠⁷⁵⁰⥳⸾⁗䙨†⁰⁵Ɑ⁵‾ⰾ⁉†††††⁵ⱡ⁴‼ⰾ‼⁰⁴䍥‼⁰††⁵䘠⁰ⱡ†††ㄠㅲⱮ⁵㱥⽦㹮㰠㹴㱨㹮㍲ ⵰‾ⵏㅥ⸠൧ੲ㱡⽭㹵㱬⽤㹴൰ੵ㱴㹡㱩⽮㸠൴੨㱡㹥㱡㹰⁰ㅤㄺ⸼ਾ㰍⼊㹩㱴⽨㹡൮ਠ㱡㹰⁰†††※㱯⽮㹬isted in the order of polygons with highest point from smallest value of y to largest value of y, and for a given value of y, from smallest value of x to largest value of x, a second line that reads one of
Perimeter: a + b*sqrt(.32)
Perimeter: a
Perimeter: b*sqrt(.32)
with a an appropriate strictly positive floating point number with 1 digit after the decimal point and b an appropriate strictly positive integer, a third line that reads
Area: a
with a an appropriate floating point number with 2 digits after the decimal point, a fourth line that reads one of
Convex: yes
Convex: no
a fifth line that reads
Nb of invariant rotations: N
with N an appropriate integer at least equal to 1, and a sixth line that reads
Depth: N
with N an appropriate positive integer (possibly 0).
Pay attention to the expected format, including spaces. Note that your program should output no blank line. For a given test, the output of your program will be compared with the expected output; your program will pass the test if and only if both outputs are absolutely identical, character for character, including spaces. For the provided examples, the expected outputs are available in files that end in _output.txt. To check that the output of your program on those examples is correct, you can redirect it to a file and compare the contents of that file with the contents of the appropriate _output.txt file using the diff command. If diff silently exits then your program passes the test; otherwise it fails it. For instance, run
python3 polygons.py --file polys_1.txt gt; polys_1_my_output.txt
and then
diff polys_1_my_output.txt polys_1_output.txt
to check whether your program succeeds on the first provided example.
When the program is run with -print as command-line argument
If the input is correct, then the program should output some lines saved in a file named filename.tex, that can be given as an argument to pdflatex to produce a file named filename.pdf that depicts the maze. The provided examples will show you what fil