Creating a bowling lane payout table is a hassle. Alright, let's let __PC do it __.
An inexperienced person who is not familiar with information systems tried to implement a tool for the first time. I hope this will be helpful as an example of improving work efficiency that even beginners can do.
Competitive bowling tournaments require a table to distribute players to the lane. This payout table states that "one player will not be paid to the same box more than once" and "any two players will not be paid more than once to the same box at the same time (in short," Is it the same box as you? " ”Does not occur)” is required. I don't think anyone outside the bowling area knows it well, so you can skip it. Anyway, it's quite difficult to create this manually + check it with your eyes (it takes more than an hour for humans to do it), so let's automate it with a tool. I put the finished product at the end of the page, so if you like (is there demand?).
① Allocate lanes to players with random numbers ② Find a part that does not meet the conditions ③ Shuffle only the problem area ④ Repeat ②③ until the problem area becomes 0. ⑤ Output necessary information
For the time being, I created a lane payout table manually using random numbers in Excel, and automated only the detection of problem areas. Since I started from a situation where I don't even understand Excel functions, I implemented a check mechanism while googled variously. I'm grateful that there is a lot of Excel-related information on the net. problem -Since the number of players and the number of boxes used are different for each tournament, it is necessary to manually assemble the check mechanism each time (it is troublesome). ・ The compatibility with Excel and enumeration is extremely bad.
It's a hassle, so I wanted to go further with automation. Alright, let's do it with programming. But you can't use any programming language. So you will learn Python3 [^ 1]. Python is visually insanely easy to understand, so I recommend it as your first language. I also considered Excel VBA (so-called "macro"), but stopped because it seems to be awkward and less versatile. The implementation was just done, but it was quite difficult (in AtCoder, it feels like connecting the implementations of about Diff800). In the end, it was about 400 lines. I also realized how difficult it is to crush the corner case. problem -Since it is input / output as a character string on Python, it is necessary to copy and paste it with an Excel file, which is a little difficult to use.
From here, we aimed to improve the input / output method. This time, I used the openpyxl module that can handle Excel files on Python. A module is like a toolbox, and importing it extends what you can do on Python. Python is especially rich in modules, so I'm really grateful. By using this module, I / O can be performed on Excel. openpyxl is especially useful, so I would like to continue using it positively in the future. problem ・ This tool cannot be shared with people who do not have Python installed.
We aimed to develop it further and make it a GUI application that works by inputting characters in the frame and outputs the lane payout table as an Excel file. Actually, I used Python's tkinter module (not tinder). I had no prerequisite knowledge, so I felt like I was just googled, but I learned a lot. It was completed as a GUI application by converting the written Python source code into an exe file using pyinstaller. Now even people who can't use Python can use the tool. ↑ If you enter something like this ... ↑ It is output as an Excel file like this.
The name list is taken from the 2019 PBA prize rankings. It's a dream-like tournament.
The completed application can be downloaded from here (Dropbox). Please play with it.
Thank you for reading until the end. Actually, I thought about turning this tool into a web application, but I gave up for the time being because I had no knowledge of html. I will report again if I challenge html.
In parallel with the implementation of this tool, we also started the Atcoder programming contest. Competitive programming was useful! I hear something like this, but it is useful for getting used to the basic handling of lists, etc., and I feel that the content up to the first half of green is also useful for the real life of non-information people.
[^ 1]: Easy Python (Mana Takahashi, SB Creative), This book was easy to understand despite its name, and I recommend it.
Recommended Posts