Unified board & card game rules foundation for MoonBit: Go, Xiangqi, Chess, Gomoku, Othello, Blackjack and Five-card Draw behind one interface, with shared GameInfo/Rng abstractions
| Game | Package | Implementation | Type |
|---|---|---|---|
| Go (Weiqi/Baduk) | core engine | delegated to wbgxiaosu/moonbaduk | turn-based, perfect info |
| Xiangqi (Chinese chess) | core engine | delegated to wbgxiaosu/xiangqi | turn-based, perfect info |
| International chess | core engine | delegated to L76148/moonchess | turn-based, perfect info |
| Gomoku (free-style) | gomoku | original — 2..=26 boards, four-direction line scan, undo | turn-based, perfect info |
| Othello (Reversi) | othello | original — eight-direction bracketing flips, pass flow, majority scoring | turn-based, perfect info |
| Blackjack | blackjack | original — seeded shoe, dealer hole card hidden, 3:2 naturals, dealer-stands-on-17 | chance + hidden info |
| Five-card draw | fivedraw | original — 2..=6 players, two betting rounds, discards, showdown | chance + hidden info + multi-player |
| Generic poker evaluation | cards | original — 52-card deck, seeded splitmix64 shuffle, 5..7-card hand evaluation | utilities |
// one interface for all board games
let c : @core.Engine = @core.Engine::make(@core.Chess)
let _ = c.apply("e2e4")
let moves : Array[String] = c.legal_moves()
// original gomoku
let g : @gomoku.Gomoku = @gomoku.Gomoku::standard()
let _ = g.play(7, 7)
// blackjack with a reproducible shoe
let bj : @blackjack.Blackjack = @blackjack.Blackjack::new(42UL)
let _ = bj.act(@blackjack.Hit)
// complete five-card draw hand, 2..=6 players
let p : @fivedraw.DrawPoker = @fivedraw.DrawPoker::new(4, 7UL)
let _ = p.bet(0, @fivedraw.Call)moon check
moon test
moon run cmd/mainInstall
Download zipUnified board & card game rules foundation for MoonBit: Go, Xiangqi, Chess, Gomoku, Othello, Blackjack and Five-card Draw behind one interface, with shared GameInfo/Rng abstractions