TicTacToeTalk
TicTacToe implemented in Logtalk
Install / Use
/learn @PaulBrownMagic/TicTacToeTalkREADME
TicTacToeTalk
A console TicTacToe game in Logtalk (3.36.0 or later), which you play against the computer.
This repo workflow automatically runs (on commit events) tests, publishes a code coverage report, and makes available as build artifacts the TAP report, the code coverage report, the API documentation, the source code diagrams, and the SWI-Prolog 8.1.x QLF files and saved state with the precompiled game.
How to play
Launch Logtalk and load the game:
?- {loader}.
Then you have a choice of difficulties:
?- game(easy)::play.
or
?- game(hard)::play.
or you can play against another human:
?- game('2p')::play.
In an easy game the computer makes random moves. In the hard game it uses a smart strategy to actively try and win, but not so smart that it's impossible to win!
Running the precompiled version (SWI-Prolog 8.1.x only)
Go to the commits
list, click on the green check mark of the latest successful commit,
and then click on details. On the build report page, click on the
artifacts list and download both logtalk.qlf and application.qlf
files. Uncompress the files, start SWI-Prolog, and load the files:
?- [logtalk, application].
...
true
After, use the queries in the section above to start the game.
Portability
Due to the use of non-ASCII characters to draw the board, the current version requires a backend that supports UTF-8 encoding. The game can currently be played on CxProlog, SICStus Prolog, SWI-Prolog, and YAP.
Design
We've tried to keep this a relatively simple but comprehensive example. So for the OO we're only using objects, parametric objects, and a couple of extensions.
A high-level view of the pre-development design (before any code!):

The implementation generated by Logtalk from the source code:
We've also made an effort to include documentation and unit tests to demonstrate the utility of the Logtalk ecosystem, hence the workflow badge and information above.
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
