Skip to content

Commit

Permalink
Properly separate 2023 vs 2024 vs latest
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnoc committed Mar 3, 2024
1 parent 51bfbc5 commit 675e200
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from 2023-01-22
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from 2024-02-10
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from $latest_date

mv "./scores/scores.txt --from 2023-01-22 --to 2024-02-10.tsv" './scores/all-time.tsv'
mv "./scores/scores.txt --from 2024-02-10.tsv" './scores/latest.tsv'
# mv "./scores/scores.txt --from ${latest_date}.tsv" './scores/latest.tsv'
mv "./scores/scores.txt --from 2023-01-22 --to 2024-02-10.tsv" './scores/2023.tsv'
mv "./scores/scores.txt --from 2024-02-10.tsv" './scores/2024.tsv'
mv "./scores/scores.txt --from ${latest_date}.tsv" './scores/latest.tsv'

python3 ./res/scoring.py $latest_date
python3 ../conway-markdown/cmd.py
Expand Down
3 changes: 2 additions & 1 deletion res/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def tsv_to_cmdr(base_name, latest_date):


def main():
tsv_to_cmdr(base_name='all-time', latest_date=None)
tsv_to_cmdr(base_name='2023', latest_date=None)
tsv_to_cmdr(base_name='2024', latest_date=None)
tsv_to_cmdr(base_name='latest', latest_date=sys.argv[1])


Expand Down
10 changes: 8 additions & 2 deletions scores/index.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
< /res/common.cmdr
< /scores/all-time.cmdr
< /scores/latest.cmdr
< /scores/2023.cmdr
< /scores/2024.cmdr

OrdinaryDictionaryReplacement: #.boilerplate-properties-override
- queue_position: BEFORE #boilerplate-properties
Expand All @@ -23,9 +24,14 @@ Rows are sorted by Net Score Per Game.
%%score-table(latest)


##{#2024} Lunar Year 2024 (甲辰年)

%%score-table(2024)


##{#2023} Lunar Year 2023 (癸卯年)

%%score-table(all-time)
%%score-table(2023)

[`mahjongscore.py`]: https://github.com/yawnoc/mahjong-scorer
[`scores.txt`]: scores.txt
91 changes: 91 additions & 0 deletions scores/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,97 @@ <h2 id="latest"><a href="#latest" class="permalink" aria-label="Permalink"></a>L
</tfoot>
</table>
</div>
<h2 id="2024"><a href="#2024" class="permalink" aria-label="Permalink"></a>Lunar Year 2024 (<span lang="zh-Hant">甲辰年</span>)</h2>
<div class="wide">
<table>
<thead>
<tr>
<th>Name</th>
<th>Game Count</th>
<th>Win Count</th>
<th>Win Fraction</th>
<th>Blame Count</th>
<th>Blame Fraction</th>
<th>Net Score</th>
<th>Net Score Per Game</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jackie</td>
<td>11</td>
<td>3</td>
<td>0.2727</td>
<td>1</td>
<td>0.0909</td>
<td>128</td>
<td>11.6364</td>
</tr>
<tr>
<td>Hwei</td>
<td>16</td>
<td>4</td>
<td>0.25</td>
<td>2</td>
<td>0.125</td>
<td>144</td>
<td>9</td>
</tr>
<tr>
<td>Conway</td>
<td>13</td>
<td>5</td>
<td>0.3846</td>
<td>3</td>
<td>0.2308</td>
<td>96</td>
<td>7.3846</td>
</tr>
<tr>
<td>Elayne</td>
<td>9</td>
<td>1</td>
<td>0.1111</td>
<td>1</td>
<td>0.1111</td>
<td>−64</td>
<td>−7.1111</td>
</tr>
<tr>
<td>Rowena</td>
<td>9</td>
<td>0</td>
<td>0</td>
<td>3</td>
<td>0.3333</td>
<td>−160</td>
<td>−17.7778</td>
</tr>
<tr>
<td>James</td>
<td>6</td>
<td>2</td>
<td>0.3333</td>
<td>4</td>
<td>0.6667</td>
<td>−144</td>
<td>−24</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>*</td>
<td>64</td>
<td>15</td>
<td>0.2344</td>
<td>14</td>
<td>0.2188</td>
<td>0</td>
<td>0</td>
</tr>
</tfoot>
</table>
</div>
<h2 id="2023"><a href="#2023" class="permalink" aria-label="Permalink"></a>Lunar Year 2023 (<span lang="zh-Hant">癸卯年</span>)</h2>
<div class="wide">
<table>
Expand Down

0 comments on commit 675e200

Please sign in to comment.