我正在为需要解析扑克手历史的 iOS 构建一些软件。由于我对解析知之甚少,我希望有人能指出我正确的方向,指点我一些教程,...
我已经开始将扑克牌分成几行,然后我开始用字符串函数处理每一行。但是现在我发现有一些解析工具可以用来编写 BNF 语法。因此,如果我想实现性能,这可能是正确的方法,对吧?但是,我对 BNF 语法以及如何使用它们一无所知,... 谁能给我指点一些初学者教程?
哦,扑克手牌历史看起来像这样:
PokerStars Game #73611647630: Hold'em No Limit ($0.01/$0.02 USD) - 2012/01/10 17:15:42 CET [2012/01/10 11:15:42 ET]
Table 'Joella VIII' 6-max Seat #1 is the button
Seat 1: S@pphiR ($0.85 in chips)
Seat 2: Pet21 ($1.96 in chips)
Seat 3: derphurp ($2.79 in chips)
Seat 4: -M-A-R-K-qaz ($0.90 in chips)
Seat 5: Rolle55 ($2.47 in chips)
Seat 6: SanderDecler ($2 in chips)
Pet21: posts small blind $0.01
derphurp: posts big blind $0.02
*** HOLE CARDS ***
Dealt to SanderDecler [Jc 2s]
-M-A-R-K-qaz: folds
Rolle55: calls $0.02
SanderDecler: folds
S@pphiR: folds
Pet21: folds
derphurp: checks
*** FLOP *** [2h 3s As]
derphurp: checks
Rolle55: checks
*** TURN *** [2h 3s As] [Kh]
derphurp: bets $0.02
Rolle55: calls $0.02
*** RIVER *** [2h 3s As Kh] [5d]
derphurp: bets $0.02
Rolle55: raises $0.02 to $0.04
derphurp: raises $0.16 to $0.20
Rolle55: raises $0.16 to $0.36
derphurp: folds
Uncalled bet ($0.16) returned to Rolle55
Rolle55 collected $0.47 from pot
*** SUMMARY ***
Total pot $0.49 | Rake $0.02
Board [2h 3s As Kh 5d]
Seat 1: S@pphiR (button) folded before Flop (didn't bet)
Seat 2: Pet21 (small blind) folded before Flop
Seat 3: derphurp (big blind) folded on the River
Seat 4: -M-A-R-K-qaz folded before Flop (didn't bet)
Seat 5: Rolle55 collected ($0.47)
Seat 6: SanderDecler folded before Flop (didn't bet)