DEV Community

Cover image for An Open Source Tool for Board Games
Cyril Kato for Sashité

Posted on

An Open Source Tool for Board Games

We are pleased to announce the release of Qi.rb 10.0.0, a flexible and robust tool designed to represent board game positions for various games, including Chess, Makruk, Shogi, or Xiangqi, among others.

Qi is game-agnostic, providing a flexible framework to represent a wide range of game states. It captures essential game details, including the pieces in play, their arrangement on the board, the sequence of turns, and other game-specific states.

One of the key features of Qi is its ability to manipulate and update game states via the 'commit' method, enabling smooth transitions between game states. The tool also incorporates an 'eql?' method for comparing different game states, useful for tracking game progress, detecting repeats, or even facilitating AI development for games.

In addition to these, Qi keeps track of the sequence of turns, providing an efficient way to manage game progress. The tool also provides access to game-specific data, such as the current arrangement of pieces on the board (squares_hash) and the pieces captured by each player (captures_hash). This information is key to understanding the current status of the game.

Finally, Qi is customizable and adaptable to your specific needs. The keys and values in captures_hash and squares_hash, as well as the items in turns and the values in state, can be any type of object.

While Qi does not generate game moves itself, it serves as a reliable foundation upon which game engines can be built. Its primary focus is on providing a robust and adaptable representation of game states, thus fostering the development of diverse board game applications.

We look forward to seeing the innovative ways in which the community will use and build upon Qi 10.0.0. For more details and to get started with Qi, visit our open source project page.

Image description

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Playwright CLI Flags Tutorial

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • 0:56 --last-failed
  • 2:34 --only-changed
  • 4:27 --repeat-each
  • 5:15 --forbid-only
  • 5:51 --ui --headed --workers 1

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Click on any timestamp above to jump directly to that section in the tutorial!

Watch Full Video 📹️

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay