ChesSkelet: micro chess program - 363 Bytes

The place for codemasters or beginners to talk about programming any language for the Spectrum.
reeagbo
Berk
Posts: 38
Joined: Mon Apr 29, 2019 8:11 am

ChesSkelet: micro chess program - 363 Bytes

Post by reeagbo » Tue Apr 30, 2019 2:44 pm

Hi all,

I discovered this forum few days ago and after some exchanges with Arkannoyed on his fantastic 3D Chess, he encouraged me to open a thread on this development I've been working on for some time.

You can play online (3 different versions with different features), see some insights on the development and have the full code in
http://chesskelet.x10host.com/

I´ve just released a new version today which leaves the project almost finished: v0.804, taking 363 Bytes in its simplest version.

Release notes.
- Coding optimizations everywhere. Kudos, Mr.Blinky!
- Full version: basic castling implemented.
- You may be surprised; ChesSkelet plays something that looks like an opening.

Image

If I detect interest I could dissect the program in this thread. Maybe someone could propose additional improvements. Let me know your thoughts on this. I've already had some nice support from other coders.

Alex
8 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: ChesSkelet: micro chess program - 363 Bytes

Post by arkannoyed » Tue Apr 30, 2019 2:55 pm

We’re definitely definitely certainly absolutely interested in seeing a nice dissection!

Also good to see you’ve shaved a couple more bytes off too.

Development threads are awesome!!!!!
0 x

User avatar
Juan F. Ramirez
Dynamite Dan
Posts: 1737
Joined: Tue Nov 14, 2017 6:55 am
Location: Málaga, Spain

Re: ChesSkelet: micro chess program - 363 Bytes

Post by Juan F. Ramirez » Tue Apr 30, 2019 5:19 pm

Taking into account that I have no idea of coding, I find these incredible shrinking chess threads awesome! :shock:

Keep both the good work!
0 x

User avatar
R-Tape
Site Admin
Posts: 2229
Joined: Thu Nov 09, 2017 11:46 am

Re: ChesSkelet: micro chess program - 363 Bytes

Post by R-Tape » Tue Apr 30, 2019 7:29 pm

Top stuff! Thanks for this.

I'm rusty and struggled with playing CAPS v lower case, but I'm pretty sure I found an illegal move bug. I moved the Knight from B5 to C7, which put the King in check, however the king didn't move and it allowed me to take the king giving the 'nonsense' error. I didn't see which move the computer made when it should have moved the King (there were only two choices).

Image
0 x

reeagbo
Berk
Posts: 38
Joined: Mon Apr 29, 2019 8:11 am

Re: ChesSkelet: micro chess program - 363 Bytes

Post by reeagbo » Tue Apr 30, 2019 10:17 pm

R-Tape wrote:
Tue Apr 30, 2019 7:29 pm
Top stuff! Thanks for this.

I'm rusty and struggled with playing CAPS v lower case, but I'm pretty sure I found an illegal move bug. I moved the Knight from B5 to C7, which put the King in check, however the king didn't move and it allowed me to take the king giving the 'nonsense' error. I didn't see which move the computer made when it should have moved the King (there were only two choices).

Image
Thanks for the testing report. :-)

Two things on this : there is a clear bug I'll try to reproduce. The king should have moved, yes. I see you could castle your king, which is totally new in this version.

On the 'nonsense' message, this is the expected behavior after check mate. There is no specific end of game message. It's explained in the game instructions in the website. Reason for this is that after program returning control to Basic the stack is not clean, so the exit is not OK 0:1. I thought it was a funny exit after all, even if it was not intended originally.

I'll look into the king not escaping the check... Some work ahead.
0 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: ChesSkelet: micro chess program - 363 Bytes

Post by djnzx48 » Tue Apr 30, 2019 11:08 pm

Looks good! Haven't managed to win yet - the computer keeps cheating when in check! ;)

Some of the knight moves are disallowed when they seemingly shouldn't be. For example, what am I doing wrong in this picture?
Image
0 x

User avatar
Einar Saukas
Manic Miner
Posts: 744
Joined: Wed Nov 15, 2017 2:48 pm

Re: ChesSkelet: micro chess program - 363 Bytes

Post by Einar Saukas » Tue Apr 30, 2019 11:28 pm

djnzx48 wrote:
Tue Apr 30, 2019 11:08 pm
Some of the knight moves are disallowed when they seemingly shouldn't be. For example, what am I doing wrong in this picture?
You are exposing your King to be taken.
0 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: ChesSkelet: micro chess program - 363 Bytes

Post by djnzx48 » Tue Apr 30, 2019 11:34 pm

D'oh! Well never mind then...
0 x

User avatar
R-Tape
Site Admin
Posts: 2229
Joined: Thu Nov 09, 2017 11:46 am

Re: ChesSkelet: micro chess program - 363 Bytes

Post by R-Tape » Wed May 01, 2019 6:49 am

reeagbo wrote:
Tue Apr 30, 2019 10:17 pm
On the 'nonsense' message, this is the expected behavior after check mate. There is no specific end of game message. It's explained in the game instructions in the website. Reason for this is that after program returning control to Basic the stack is not clean, so the exit is not OK 0:1. I thought it was a funny exit after all, even if it was not intended originally.
Aye I knew from the website. I didn't mean to suggest that was a bug, in fact, I like this feature!
0 x

reeagbo
Berk
Posts: 38
Joined: Mon Apr 29, 2019 8:11 am

Re: ChesSkelet: micro chess program - 363 Bytes

Post by reeagbo » Wed May 01, 2019 8:33 am

R-Tape wrote:
Tue Apr 30, 2019 7:29 pm
Top stuff! Thanks for this.

I'm rusty and struggled with playing CAPS v lower case, but I'm pretty sure I found an illegal move bug. I moved the Knight from B5 to C7, which put the King in check, however the king didn't move and it allowed me to take the king giving the 'nonsense' error. I didn't see which move the computer made when it should have moved the King (there were only two choices).

Image
Problem identified and fix ready. The problem is that it costs me 4 bloody additional bytes! My unwritten rule is not to publish a new release until is as small as the previous one, so it will have to wait to see the light.

Thanks again!
1 x

Post Reply