FIT9136 Assignment 2

Semester 1 2021


Table of Contents


1. Key Information


1.1. Learning outcomes

1. design, construct, test and document Python programs;

2. demonstrate on advance topics of python, like classes, objects, visualization;

3. evaluate different algorithms and analyze their complexity;

4. translate problems into algorithms with appropriate implementations by investigating different strategies for the algorithm development


1.2. Do and Do NOT


1.3. Marking Criteria

Your work will be marked on


1.4. Submission details

Submit to "Assignment 2 Submission" on Moodle:

● A2_studentID.py4

Containing each of the tasks covered in Section 3. Key tasks (60 marks)


Note:

• The marks will be deducted if this requirement is not strictly complied with.

• Submissions will not be accepted if left in Draft mode. Be sure to submit your files before the deadline not to incur late penalties.


2. Getting help

2.1. English language skills

if you don't feel confident with your English.

● Talk to English Connect: https://www.monash.edu/english-connect


2.2. Study skills

If you feel like you don't have enough time to do everything you need to, maybe you need a new approach

● Talk to a learning skills advisor: https://www.monash.edu/library/skills/contacts


2.3. Things are tough right now

Everyone needs to talk to someone at some point in their life, no judgement here.

● Talk to a counsellor: https://www.monash.edu/health/counselling/appointments (friendly, approachable, confidential, free)


2.4. Things in the unit don't make sense

Even if you're not quite sure what to ask about, if you're not sure you won't be alone, it's always better to ask.

● Ask in the Ed forum.

● Attend a consultation.


2.5. I don't know what I need

Everyone at Monash University is here to help you. If things are tough now, they won't magically get better by themselves. Even if you don't precisely know, come and talk with us, and we'll figure it out. We can either help you ourselves or at least point you in the right direction.


3. Key tasks (60 marks)

This assignment is broken into several parts. The tasks lead to one another, and however, if you are unable to finish a section, you can try to write the next section under the assumption you have completed the previous one. E.g., if you can't finish section 3.2, you can try to finish section 3.3 using our provided example in section 3.1.


3.1. Overview

You will be analyzing chess games that are stored in Portable Game Notation (PGN). For more information on the PGN format, click here. The provided game file will have the extension ".pgn" and can be viewed if opened in notepad. An example of the file format has been provided for you; however, the file that will be used for marking will be of different games but will follow the same formatting.

You do not need to understand how to play chess to complete this assignment (although the teaching team strongly recommended that you learn to play chess because it's a fantastic game to play).

The file provided has the following structure:

[Event ""]

[Site "Daugavpils, Latvia"]

[Date "1978"]

[Round ""]

[White "Garry Kasparov"]

[Black "Semon Palatnik"]

[Result "1-0"]

1.e4 Nf6 2.e5 Nd5 3.d4 d6 1-0

Meta-data about the game location, date, white player, black player, etc., is presented in brackets (yellow colour). The game moves are listed on a single line after the meta-data information (blue colour). The numbers followed by a period indicate each move's order, and there are two players. The numbers after a game string is the result of the game (green colour).


3.2. Filtering the Game Data (20 marks)

Remove all the metadata from the file, and extract a list containing each game as a clean string. And write the game string in a file named “game_string.txt”, make sure you follow the sample file’s format ONLY.


3.3. Sub files (20 marks)

Using the game strings from the first part, separate the moves of the white player into its file, and the black players into its file. These files should have the following name convention: "1w" and "1b", Game 1 white, and Game 1 Black, respectively.


3.4. Dataframe counts (10 Marks)

Make a data frame that collects the counts of the first moves per game and returns a tuple that contains two data frames: one for white moves, and one for black moves


3.5. Plotting (10 marks)

Plot the ten most common first moves. Plot the black moves and white moves in the same graphic and explain your understanding from the graph.


Notes:

• You may use os, re, math, random, NumPy, matplotlib, SciPy, & pandas libraries.

• The key task (section 3) has 60 marks, covering the functionality of marking rubrics, while the rest of the 40 marks consist of documentation, code architecture & style.

• For Code Architecture & Style:

Use the class & object concept to design and organize your code, in order to get HD grade in this section.

Use of only functions will get maximum of D in this section.