Open lance6716 opened 5 years ago
Thanks for your contribution! I 've made these two tools work right now. Here's my planning:
Tile
, TileSet
Waiting
WinPattern
and merge duplicate search algorithms for easily read and use.And for contribution, a contribution guide is required (Maybe a issue template/pull request template, but I've no idea about how to do that).
I'll remain this issue open for discussion. Any crazy ideas are welcomed!
For
class Tile and TileSet use @total_ordering, according to official doc, should evaluate if it's the bottleneck of the performance.
I've benchmarked with cProfile and found that main bottle neck is about manipulate and create TileSet(Counter)
s. the operator is mainly heavily used in sorting, so I think that le, eq and ne is enough.
For
check if collections.Counter could sorted by key internally when print, so we don't need TileSet.re_sort()
Counter(include normal dicts) after Python 3.7 is guaranteed that keys will preserved order of insertion. it's not the order we needed (if insert 3m first, 2s later, 1m last, the order will be 3m2s1m). so printing needs resort.
By the way, Interantionalized document is needed, but I've no idea of how to do that.
we should first decide which doc framework to use, in fact I'm not familiar with python technology stacks, so don't rely on me🤔
Ledenel notifications@github.com 于 2019年2月4日周一 22:33写道:
By the way, Interantionalized document is needed, but I've no idea of how to do that.
- Add zh-CN and en-US documentation support.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Ledenel/auto-white-reimu/issues/3#issuecomment-460270302, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnIprfIxNxZxSmdXjsdI9ipdKrVoapIks5vKES6gaJpZM4agDx2 .
Here's TODOs collected from comments below:
[ ] Add class doc to give brief explanation, in order to make new developer easier to understand.
[ ]
Tile._hash
andTile._tuple_view
seems duplicated, check if should keep only one of them.[ ] Add win pattern of Thirteen Orphans(国士無双)
[ ] Add input-check about the number of tiles, input grammar and same tile overflow.
[ ] Add matching for yaku(役) and score calculation
[ ] Add continus integration and cover all codes with unit test
[ ] Add documentation for Tile, TileSet Waiting WinPattern and merge duplicate search algorithms for easily read and use.
[ ] Add safe tiles calculations based on remain waiting forms counting(i.e. how many 68s, 56s, 89s, 7s could waiting for 7s without furiten(振听)).
[ ] Add zh-CN and en-US documentation support.
[x] checked:
TileSet.re_sort()
should be called to keep insert order invariant.[x] checked: class
Tile
andTileSet
use@total_ordering
, according to official doc, should evaluate if it's the bottleneck of the performance.Very useful and a good change to learn Python, thanks owner.
Now I'm reading the source code, here I wrote potential development.