Activity

leo.turato217

Hello,
I had to rewrite a quarter of my 630~ line PYTHON FILE. Because I deleted the repository (by accident)
I know it’s been a while, but I have been juggling Me GCSE re exam with this so it’s been really hard to work on it.
But I have made some major progress; I have finally been able to make a demo for you guys to be able to use. By putting pyscript into my HTML file I could run python code in the browser client-side. This has been very helpful as I have approximately 630 lines of python code, and I need to get a demo to ship this project, so if it wasn’t for pyscript, I would have had to rewrite the entire program in js.

A quick guide on how to use it:

  • You are White, for now you cannot change color
    -To select piece click on it, it’s square should go green, then to move it click on a possible move. (blue)
    -It’s probably Has a few bugs, I have tried my best to remove them

Anyways other than that, I have the bot up and running, it doesn’t have all the factors I mentioned earlier but, it I have managed to include, Position, Mobility, and Material Gain and loss. So lets just say It could beat Martin on chess.com - It can’t checkmate ;)

Notes:

  • I haven’t managed to include checkmate mechanic; too busy focusing on demo :(.
  • so currently no way to win the game.
  • needs bot upgrades more factors, more than one move depth

Also it might take a while to load. ~ 5 seconds

bye see you next time.

0
leo.turato217

Hello my first devlog.
Not much to see here honsetly, but..
By the next devlog I will aim to have a ball bouncing on walls.
Bye

0
leo.turato217

Hello,
I have been working on the checkmate, but it’s full of bugs.
I have added lots of new features for example:
Undo, Load (from a list of moves), castling, promotion

I am going to start work on the actual bot now because I am getting tired of the checkmate part; I will come back to fix it later.

Anyways for the bot, it will just have to rate, based on some factors, every possible move and then pick the one with the best score.
Each factor will have a weight which will make it more/ less important, as a bigger weight will affect the overall score of a move more than a smaller weight.

Here are some of the factors, with a brief explaination:

#mobitlity- how many possible moves the opponent can do
#pieces- the
#center space- how many pieces in the center
#space in enemy territory- how many spaces in the opponents side of the board can you pieces move to
#king check surround- how many spaces around the king are in check
#defence- how many of your pieces are defended
#attack- how many opponent pieces are your pieces attacking

Goodbye for now!

Attachment
0
leo.turato217

Ok, I’m back!!!
I know its been a long time since I last released a devlog but I have Made loads of progress!
Most of this time has been spent on the bishop movement (aprrox- 5 days)
It was so hard to get working and was driving me insane.

Eventually I made most of the basic moves for each piece, so they can all do their standard ones.
Although I haven’t yet implemented checks and special moves like en-passant or castling.
but we’ll get to those later

As you can see we are no longer just using plain-old ascii art I have upgraded the visuals and am now using html to render the chess board and python to play the actual game.

You might have noticed that the color scheme and the pieces look exactly like the ones on chess.com.
well I got the images of the pieces off the chess fandom:

https://chess.fandom.com/wiki/Knight

For the grid colors I just looked up standard chess board colors and that’s what came up.

After I get the other stuff sorted, I should be able to actually get started on the actual bot.

Anyway goodbye (for now)

Attachment
Attachment
0
leo.turato217

devlog 2-
hello,

I finally created the chessboard, the main aspect of this project,
I was going to use pygame to display the board but It wouldn’t work when I tried to use it in github code spaces. Instead, I settled on using ascii art, and displayed the console.

Next up, I will add moves, checks, a way to win, and everything else that makes a chess game.
The next dev-log might take a while though, I think the system to track if the moves you make are legal, will take a while to make.

Note: If you use this, you might want to turn the character size down in the editor settings because otherwise it might not load properly.

Attachment
1

Comments

Anass Zakar
Anass Zakar 2 months ago

omg another one coding chess 🙏

leo.turato217

I’m working on my first project! I have never built anything like this before, so this should be a learning experience. :)

Attachment
0