ruby-on-rails – 在Ruby中解析(在Rails上)

ruby-on-rails – 在Ruby中解析(在Rails上),第1张

概述我想写一个Rails应用程序来帮助我进行在线扑克.我在PokerStars上玩,并且每个手牌都有可用的文本数据.它的格式是这样的: PokerStars Game #27457662450: Tournament #157033867, Freeroll Hold'em No Limit - Level IV (50/100) - 2009/04/24 20:39:44 ETTable '15 我想写一个Rails应用程序来帮助我进行在线扑克.我在PokerStars上玩,并且每个手牌都有可用的文本数据.它的格式是这样的:

PokerStars Game #27457662450: Tournament #157033867,Freeroll  Hold'em No limit - Level IV (50/100) - 2009/04/24 20:39:44 ETtable '157033867 830' 9-max Seat #1 is the buttonSeat 1: DortheaV (7624 in chips) Seat 2: Currly234 (3016 in chips) Seat 3: paolilla (3086 in chips) Seat 4: triumph888 (1571 in chips) is sitting outSeat 5: Minchausti (1185 in chips) is sitting outSeat 6: madmike11847 (1195 in chips) is sitting outSeat 7: alamodey (4038 in chips) Seat 8: whiskerbob (3365 in chips) Seat 9: SHpic76 (1115 in chips) is sitting outDortheaV: posts the ante 10Currly234: posts the ante 10paolilla: posts the ante 10triumph888: posts the ante 10Minchausti: posts the ante 10madmike11847: posts the ante 10alamodey: posts the ante 10whiskerbob: posts the ante 10SHpic76: posts the ante 10Currly234: posts small blind 50paolilla: posts big blind 100*** HolE CARDS ***Dealt to alamodey [8s Ks]triumph888: folds Minchausti: folds madmike11847: folds alamodey: calls 100whiskerbob: folds SHpic76: folds DortheaV: folds Currly234: calls 50paolilla: checks *** FLOP *** [5c 4h 6d]Currly234: checks paolilla: checks alamodey: bets 234Currly234: folds paolilla: folds Uncalled bet (234) returned to alamodeyalamodey collected 390 from potalamodey: doesn't show hand *** SUMMARY ***Total pot 390 | Rake 0 Board [5c 4h 6d]Seat 1: DortheaV (button) folded before Flop (dIDn't bet)Seat 2: Currly234 (small blind) folded on the FlopSeat 3: paolilla (big blind) folded on the FlopSeat 4: triumph888 folded before Flop (dIDn't bet)Seat 5: Minchausti folded before Flop (dIDn't bet)Seat 6: madmike11847 folded before Flop (dIDn't bet)Seat 7: alamodey collected (390)Seat 8: whiskerbob folded before Flop (dIDn't bet)Seat 9: SHpic76 folded before Flop (dIDn't bet)

是否有适用于Ruby的解析库或我是否必须手动和Hackily执行此 *** 作?

解决方法 这听起来像是Regex的工作!我怀疑使用任何库会使它更容易解析,因为它是一个非常自定义的格式,你只需要劈开它. 总结

以上是内存溢出为你收集整理的ruby-on-rails – 在Ruby中解析(在Rails上)全部内容,希望文章能够帮你解决ruby-on-rails – 在Ruby中解析(在Rails上)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1288123.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存