dartshogi 0.1.0 copy "dartshogi: ^0.1.0" to clipboard
dartshogi: ^0.1.0 copied to clipboard

WIP - Provides shogi and shogi variants rules and operations including shogi move generation, read and write SFEN, USI, KIF/CSA.

lishogi.org GitHub Actions Workflow Status

WIP - Shogi and shogi variant rules written in dart. Based on dartchess and shogiops.

Features #

  • Completely immutable Position class
  • Read and write SFEN
  • Read and write USI
  • Shogi rules:
    • move/drop making
    • legal moves/drops generation
    • game end and outcome
    • setup validation
  • Shogi variants: Minishogi, Chushogi, Annanshogi, Kyotoshogi, Checkshogi, Dobutsu
  • KIF and CSA parser and writer (NOT YET SUPPORTED)
  • Move notation - Western, Japanese, Kitao-Kawasaki, Yorozuya
  • Bitboards
  • Attacks and rays using hyperbola quintessence

Example #

import 'package:dartshogi/dartshogi.dart';

  // Parse sfen and create a valid shogi position
  final pos = parseSfen(Rule.shogi, initialSfen(Rule.shogi)).getOrThrow();

  // Generate all legal moves
  assert(pos.allMoveDests().length == 40);

  // Parse usi
  final move = MoveOrDrop.parse('7g7f')!;

  assert(pos.isLegal(move));

  // Play moves
  final pos2 = pos.play(move).getOrThrow();

  // Detect game end conditions
  assert(pos2.outcome() == null);
0
likes
150
points
105
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

WIP - Provides shogi and shogi variants rules and operations including shogi move generation, read and write SFEN, USI, KIF/CSA.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

lishogi.org

License

GPL-3.0 (license)

Dependencies

fast_immutable_collections, meta, result_dart

More

Packages that depend on dartshogi