You are browsing as a guest. Sign up (or log in) to start making projects!

GunRattler28

@GunRattler28

Joined June 9th, 2026

  • 31Devlogs
  • 8Projects
  • 3Ships
  • 30Votes
Open comments for this post

2h 39m logged

I was so unimpressed by how my old arrows looked I just completely switched libraries! I now use pygame instead of tkinter. It offers much more graphical customisability and now I can draw arrows (and other shapes) with true transparency instead of just stipples. One of the main downsides of pygame is that it constantly redraws each frame. This takes computing power and drains battery. To stop this I created a redraw boolean which tells my script when to redraw. This means instead of redrawing every single frame I redraw whenever something actually changes. Due to pygame I also customised the arrows so that the tails are rounded. This means that multiple arrows from the same point looks much cleaner. I also get true translucency instead of stipples and I added an icon!

0
0
4
Open comments for this post

4h 11m 2s logged

Need to get your strategies into something you can see? Lines let you do just that. Right clicking and dragging draws a line that follows your cursor around. Right clicking again places the line. The lines are automatically centred so that they snap to the centre of the squares. If you line starts and ends at the same place it creates a circle instead. I also spent lots of time making sure my bitboards are used properly as when I created the array last time I used it for more than I intended and lost most of the arrays of bitboards. I also noticed that the promotion GUI wasn’t properly centred and so fixed that. I don’t really like the lines as they use stipples instead of a solid colour and overall don’t look nice but tkinter doesn’t offer transparency apart from stipples and doesn’t allow lots of customisation of the arrows. Next I will likely try to add en passant.

0
0
5
Open comments for this post

4h 4m 44s logged

Finally, promotions! This was the last major part of chess that I didn’t have. I added it by finding the row of the piece when I move something. I hardcoded it so that it knows when the pawn is at the last row. When at the last row, it runs a choosePromotion() function. That function then creates a frame inside of my window. I then loop for each of the choices of the pieces I can choose. For each of these pieces I create a button with the piece (in the correct colour) in the centre. The frame waits until I pick a choice before adding a 1 on that piece’s bitboard at the correct location and removes the 1 on the pawn bitboard. Thats all I need to do to register a promotion! The rest of the time I spent optimising my code and realising that I didn’t have to use just a bitboard or an array, I could use both. Knowing that, I removed my getPiece() function and instead used an array to find the piece at a row and column. This is more efficient as arrays have a lookup time of O(1) whereas the getPiece() function has a lookup time of O(n) in the worst case. This is because my getPiece() function worked by cycling through each bitboard to find what piece was at a certain coordinate. This meant that I could also remove my totalPieces bitboard since this was only used in the getPiece() function to avoid cycling through all 12 bitboards if there was nothing there. Overall I’m really happy with how everything is going as I have all I really need for a proper game of 2 player chess. Next I am going to try and add the small things I am still missing such as En passant and the 50 move rule.

0
0
5
Open comments for this post

1h 31m 29s logged

Stalemates and three-fold repetition have now been added. Stalemates are calculated if legalMoves(turnColour) returns none but the king is not in check. I find if there is three-fold repetition by storing a hash of the board every move. This is stored in a dictionary as dictionaries are much better than arrays for lookups. After each move I see if that board state is in the dictionary. If it is I increase its value by 1. If not I set its value to 1. I then see how many times its reached that board state and if it is 3 times I end the game and show bright red text saying ‘Three-fold Repetition! Nobody wins!’. The hash includes piece positions, turn colour and castling rights as these are 3 of the 4 criteria that FIDE use. The fourth is en passant however that has not been added yet. Next I will add pawn promotions as this is the last major thing I don’t have.

0
0
5
Open comments for this post

2h 21m 11s logged

Castling! I’ve actually added castling this time. The castling also works with undo / redo move so that it undoes and redoes the move correctly. I’m starting to think my python file is getting a bit big now so I also created a few helper functions to help reduce code duplication. Its 572 lines currently. Luckily I am quite close to finishing the actual board and getting everything ready for a 2 person game of chess. This was my first goal so that the bot just becomes one of the players. Once I’m ready for a 2 person game of chess I’ll try to create another python file for the bot. This will help me keep track of what is doing what. Next I am going to add pawn promotion as that’s one of the biggest things that I don’t have yet. It is essential in late game and so is one of my priorities.

0
0
3
Open comments for this post

2h 54m 39s logged

Ever misclick and sell the game? Well not anymore! You can now undo moves by tapping the left arrow on the keybord and also redo those same moves if you change your mind by tapping the right arrow! I did this by adding a saveMove() function which I run after every move I make. This saves the details of the last move to the moveHistory array:

  • Piece Moved
  • Start Position
  • End Position
  • Piece Captured (Just “” if None)
  • Turn Colour
  • Moves so far

In my undoMove() function I remove the last move done and add it to an array called redoHistory. I then set all the details to the last entry in moveHistory. I do the same in my redoMove() function excpet I use the last entry in redoHistory instead. I’ve allowed undos after checkmate so that you can look for what went wrong and try other moves that might’ve stopped it. I also added sound! You’ll be able to see / hear all of this if the video uploads instead of just a screenshot. Next I am going to add castling (for real this time).

1
0
6
Open comments for this post

2h 41m 32s logged

The game can now end! I have added a check to see if it is checkmate. When it is checkmate bright red text appears on the screen that says “Checkmate! WINNER wins!” (it says the colour which won not WINNER). I have also changed it so that when a player is in check they are forced to make a move that stops them from being in check. The only circles that come up are ones which would block the check to make it a bit easier for players. I’ve also made it so that my new function blockCheck() takes the calculations made by calculateLegalMoves() and uses it to display and allow only legal moves. As well as this anywhere that used to call calculateLegalMoves() now calls blockCheck instead. By making sure each function does 1 task it makes debugging easier ( not that anything would ever go wrong… ). Next I am going to try and add castling as this is a crucial mechanic that is used often.

0
0
4
Open comments for this post

2h 51m 49s logged

I’ve added better red and green overlays that are translucent so that you can see through them an easily know what piece you are taking. But most importantly, I’ve added check detection. I created a few new functions to do this. The first function I created was the isSquareAttacked(row, column, atkColour) function. It works by cycling through the bitboards and checking if they are atkColour or not. If they are find the type of piece and those pieces could attack the king. I think this will be helpful when I start to actually make the bot. I also created a simple findKing(colour) function to see where the king is so that I can parse that information into the isSquareAttacked() function. I then get a boolean. If it is true (the king is in check) I add the red overlay to the king so that the player easily knows they are in check but I don’t actually force them to block the attack yet. I think the overlay should be different but am not sure what to make it (gimme some ideas). I also created a slidingMoves() function as in my calculateLegalMoves() function I had ~40 lines of almost fully repeated code. Next I am going to force the player to block the check and end the game if it is checkmate.

0
0
4
Open comments for this post

57m 44s logged

Finally took the time to change the piece textures so that black has an actual piece colour and you don’t get confused about whose pieces are whose

0
0
6
Open comments for this post

1h 17m 5s logged

I added another iframe for my movie website and a photo of my chess bot in its current state. I also made it so that the text is on the left then on the right so that the website doesn’t feel dull and has a bit of life instead

0
0
6
Open comments for this post

3h 44m 19s logged

I completely changed the look of the website and it now has an iframe of my puzzle website which allows you to complete the first level inside the portfolio website.

0
0
3
Open comments for this post

3h 24m 6s logged

I’ve added dots to show where you can move when you click on a piece. If the position you want to move the piece to the dot is green but if it has an enemy piece the dot is red. Sadly, tkinter (the library I’m using) doesn’t support transparency. Because of this the dot takes up some of piece you want to capture. I can fix this by instead of drawing a circle drawing a translucent image… but tbh i rly cba. I will eventually do it to make it look better and actually add black pieces but i want to focus on getting things to actually work for now. The reason why this took me so long to implement is because as I was making the function to draw the dots I found that it was doing something very similar to my validMove() function but it was MUCH more efficient. In the old function I went through every square on the board and looked if the piece selected could get there. This is very inefficient and would build up quickly when I call the function 1000s of times per second (when I eventually add the bot). In my new function I look at the selected piece and have an array of each of the places it can move relative to its position. I then add the dots to those places if they are able to move there. This ended up with me just completely removing the old function and knowing its a valid move if there is a dot there. Next I am going to add something to see if the king is in check and maybe add some text when it is checkmate.

0
0
5
Open comments for this post

2h 33m logged

I’ve implemented bitboards instead of an array to store my board. At first I didn’t understand why bitboards were so good but after an amazing youtube video (here) I understand them and love them. I use them by having a 64 bit long integer (wow thats long) that represents the 8 by 8 board. Each bit can either be a 0 or 1 and represent whether there is a piece there or not. But you might think then how do you know what type of piece each 1 is? Thats why I use 12 bitboards (technically theres 1 more I added for extra efficiency but I don’t need that). Each of these 12 bitboards represents a type of piece in a specific colour (for example: white pawns and black pawns have 2 different bitboards). Then when I want to move pieces I create a position integer which is just 63 zeroes and a single 1 where the piece should be. I then invert this and use an AND statement so that all of the results for the AND are true where there are pieces apart from where I set the 1 at the start (though it is now a 0).

0
0
5
Open comments for this post

3h 39m 31s logged

Added move legality. You can now mostly only make legal moves however I have not added something to checks if the king is in check. I made sure the move was legal by taking the startRow startColumn and endRow endColumn. I then look at what piece is being moved and ensure it is ok. If it isn’t nothing happens when you try to click and you have to make another move. I made sure that the correct colour moves as well. I also haven’t added pawn promotions, castling or en passant (tbh im not 100% certain on the rules of en passant). I couldn’t add castling as I don’t have a move history so would have no way of knowing if the king or rook have moved before. I’m now working on converting my current way of storing the board (a 2D array) into bitboards. After some research I found that bitboards are more than 5 times more efficient than arrays!

0
0
2
Open comments for this post

1h 58m 31s logged

I can now move pieces! But there is no legality check yet. I also added a green outline if you select a piece. It works by listening for a click. Then when it gets a click it takes mouseX and mouseY and divides by positionSize to find which row and column it is on. It then checks against the board to see what is on that position. If it is a piece then it creates an outline and sets that as the active square. If it is empty AND active square has a value, it moves the piece.

0
0
4
Open comments for this post

1h 26m 12s logged

I’ve finally decided to actually making a chess bot and stick to it! So far I’ve set up the chess board for just visuals. Everything right now is purely visual. I am using python and the tkinter library.

0
0
2
Open comments for this post

9h 59m 29s logged

I’ve improved my enderchest UI (still have to add backpack UI) but its a bit buggy right now. Working on improving it by not being stupid and just using the functions mojang provided. Idk why I didn’t before lol

2
0
7
Open comments for this post

10h 16m 20s logged

I found that the storage gui felt old and boring and so I made my own. If you click on Ender Chest it runs the /ec 1 command to open the first ender chest page. You can use the buttons that are built into it to go to over pages. The numbers correspond to backpacks. Clicking 1 does /bp 1. (Took a long time because it was supposed to look like firmaments where it is all the pages shown at once but I couldn’t do that)

0
0
8
Open comments for this post

1h 32m 12s logged

I realised a crucial error! Slot locking wasn’t permanent. After an hour and a half of hard work I’ve managed to make slot locking permanent. Now whenever a slot is locked the slot number is written into a file that lives in the config file of minecraft folder. When the slot is unlocked it is deleted from the file. I had to spend a while making sure that it only locks slots when on Hypixel Skyblock but now when you join, it reads all the slots in the file and locks those slots.

0
0
9
Loading more…

Followers

Loading…