首页 > > 详细

Python辅导:COMP9021 Polygons解析Python编程

,,。
 

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

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!