A Chinese chess game written in Prolog.

How we built it

The game is played on the console built by Prolog

. Load the code into your Prolog interpreter, e.g, SWI Prolog or Online IDE and run main.

swipl ChineseChess.pl
main.

Then follow the prompts to play :)

Challenges we ran into

  • Planning out the logic behind the Chinese Chess rules.
  • Checking whether players follow the rules.

Accomplishments that we're proud of

We are proud that we learned a new programming language and complete a project in just a few days through theoretical knowledge and a lot of practice, even though we knew nothing about it before. We are also proud that we successfully write Chinese chess game, which is one of the most popular board games in China.

What we learned

First, we learned logic programming languages and Prolog in particular, which is different from other languages as a declarative programming language. We also learned Common Sense Reasoning and Answer Set Programming. Second, we improved project collaboration skills with deadlines creeping and pressure. Finally, we learned that you'll never know how close you are to succeeding if you quit now.

What's next for Chinese Chess

We plan to optimize the following in the future:

  • [ ] Implement Chinese Chess AI man-machine battle.

  • [ ] Output possible next steps for the new beginner player mode.

Built With

  • prolog
Share this project:

Updates