Project 1 Approach - Chess Tournament Rankings

Author

Supriya P.

Introduction (Approach)

The goal of this project is to take a text file containing chess tournament results and turn it into a clean CSV file with one row per player, containing their name, state, total points, pre-tournament rating, and the average pre-tournament rating of the opponents they played.

My plan is to first read the raw tournamentinfo.txt file into R and get a sense of its actual structure before writing any parsing logic. From what I can tell, each player’s information is spread across two lines: one line with their name, total points, and round-by-round results, and a second line with their state, USCF ID, and pre- and post-tournament ratings. I’ll need to extract both lines for each player and combine them into a single row.

The part of this assignment I expect to be the most challenging is calculating the average pre-tournament rating of opponents. The round-by-round columns in the file don’t list ratings directly. They list which player each person was paired against in that round, identified by a pair number. So for each player, I’ll need to figure out who they actually played by matching those pair numbers back to other players in the tournament, look up each of those opponents’ pre-tournament ratings specifically, not their post-tournament ratings, and then average them.

A second challenge I anticipate is that the file isn’t clean to begin with. The formatting uses dashes and pipe characters to create a table that looks fine visually but isn’t structured data. I’ll need to skip the junk rows at the top and use some combination of string splitting or regular expressions to pull the right pieces out of each line.

My plan is to work through the parsing logic first, starting with just the first two or three players so I can check my extracted values against the Gary Hua example given in the assignment, before scaling up to the full file.