A Chinese chess game written in Prolog.
(For details please visit Chinese Chess.)
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 :)
- Planning out the logic behind the Chinese Chess rules.
- Check whether players following the rules.
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.
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.
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.