Chess in C banner

Chess in C

11 devlogs
13h 42m 34s

Updated Project: A recreational, ongoing attempt to create a simple two-player local chess game in the C programming language.
This project has been under development for several months, but much of its progress has not been tracked by Wakatime.

This project uses AI

Used Github Copilot for search, code inspirations and translations.

Demo Repository

Loading README...

ancamasi.2345

I changed the representation of each piece from the letters to the icons for each one on the chess board!
I’ve also added the stalemate detection (when the king isn’t on check, but there are no legal moves).

Attachment
1

Comments

Anass Zakar
Anass Zakar about 1 hour ago

omg another one coding chess! we should make a private club of chess coders

ancamasi.2345

I’ve finished the translation of the game! Now, the users can choose between English and Portuguese at the beginning of the game!
It was a little time-consuming (and tedious), but the result is admirable 🙂
The updates are on the latest release: https://github.com/acms2345/Xadrez-em-C/releases/tag/v1.2

0
ancamasi.2345

I’m FINALLY making a translation of the game to English.
The updates aren’t on the GitHub release or repository yet, because I want to finish the translation before I make this. But I intend to do it soon!

Attachment
0
ancamasi.2345

Now, I’ve added an internal mechanic to better verify checkmate.
During this time, I also made some minor modifications to the README.

0
ancamasi.2345

I’ve added a system to check for moves that leave the king himself in check (a illegal move in Chess rules, but it was possible on the game).
I’ve also made a workflow to generate the executable versions of the code, so you guys can test it!

Attachment
0
ancamasi.2345

I try to explain better on the README how to use my game, including how to download and compile it.
I also made an adjustment to the 50-move rule (It wasn’t working because I forget to reset the variable after the turn).

Attachment
Attachment
0
ancamasi.2345

Shipped this project!

Hours: 2.22
Cookies: 🍪 15
Multiplier: 6.66 cookies/hr

“Why not create a chess game on C programming language?”
I wanted to make this this two-player local game to practice my knowledge of the C programming language, since I’m studying it at school. I learn about pointers, files, about publishing and editing codes online and, consequently, MANY OF CHESS RULES!
It’s still a little short of having all the rules of chess. But, considering it was made purely for entertainment, I already think it’s quite good.

ancamasi.2345

Finally, I adjusted the board to the standard chess layout (white pieces in positions 1-2 and black pieces in positions 8-7).
I also fixed some data inputs after becoming aware of certain bugs.

0
ancamasi.2345

I made some modifications to the code structure. I changed the name of the chess.c file to game.c, added the game.h file, and I’m trying to organize the code better.

Attachment
0
ancamasi.2345

I basically edited the README and some parts of codes to add some advices in English. Now, there’s a entirely version of the README in English, keeping the Portuguese version.
I plan to add more English information on the source code, but currently it’s entirely in Portuguese.

Attachment
0
ancamasi.2345

Basically, during that time I tried to create a demo link so you could test the actual version of the game. In the most of the time, I tried to share the project on GitHub Sites using a HTML integration, but that didn’t work.
So, I put the demo on OnlineGDB. The link to access the demo is https://onlinegdb.com/mCVxTRf8M (no login or download required).

Attachment
0
ancamasi.2345

I basically added the 50-move tie-checking system and fixed a problem I was having with the initial two-square pawn movement.

Attachment
0