Day 282: Sunday Chess

Today I slept in until 9:15ish. It was bright, well bright for rainy Oregon.

I had stayed up late last night playing chess against Lasker, my chess computer, Millennium’s Lasker Special The King Edition. I was having an issue with the chess computer seemly changing my chess piece positions. The board was lighted-up with warnings, and the AI seemed a bit lost. I finally grasped that the new code I installed with all the new features had made the board more sensitive, and I need to pick-up and place pieces.

No more sliding pieces. I like to slide the chess pieces when playing against human players who usually think you did not see something they missed and then slide into it. That is not allowed in competitive chess, and I just need to comply with the rules.

When I finally worked out that it was me causing the issue, it was late, and I ended up playing a long game against Lasker. I set Lasker to a higher level, but I still managed to exchange out most of the pieces (I admit I was taking hints for Lasker) and then had the long game of rooks and three more pawns than the computer player had left. I used the computer’s hint to avoid a misplaced piece as this was just an exercise of repeating the same moves over and over while reducing the enemy king’s freedom of movement. The computer finally conceded. I just wanted to see that it would still concede at the higher settings. It does.

I played another chess game this morning and lost. Lasker crushed my mangled opening, and I gave in before it got worse. I had peanut butter toast and coffee for breakfast while being crushed.

I started working on my chess program today. Last year I wrote a short computer Python program, 450+ lines, to use the newish Python-Chess library to play chess. The library supplied the chess framework. I just had to write a loop to play and accept moves to have a working chess program. I did not write a pawn promotion handling routine yet, but the chess programming was working well enough that you can play a game.

I spent the morning getting the program working again. First, I had to get PyCharm updated. This is my fav IDE for Python development. I had to get my license accepted again. I pay for an annual license, but the vendor requires a check every month to have a license. I then updated PyCharm to the newest release. Yes, these tools are not free and require constant attention.

Next, the program is running on older Python and a legacy version of the Python-Chess library.

As a break, I served the remains of the quiche I made to Susie and me for lunch. It was better reheated.

Anaconda is the program I use to load Python, and it needs a major update. I read the warnings on the Stack Overflow Website, started the update, and took a shower. It gets all updated for a long time while I get dressed. I load Python 3.8 as a separate environment. I have 3.7 Python as default. I then load the new version of the Python-Chess library for both 3.7 and 3.8.

I have to reset the version of Python that PyCharm needs. This takes an hour to work out. It still does not work. Each project has an environment too. It is the wrong version too. I finally get this all changed to Python 3.8.

Why Python 3.8? It is newish and getting good support.

After another hour of frustration and running the update everywhere, I finally call up a terminal inside of PyCharm and order an update of the Python-Chess library, and that finally works using Python 3.8!

This open code is always fighting version changes of tools and libraries. My Apple also does not love Python 3.6 as it is running Big Sur OS. This version stuff can be difficult to solve. Worse, often there are security issues in earlier versions that force the change to the fixed versions. Staying on an older version will likely let you get hacked.

I then run the checks on the code and fix two classic bugs using the global variable in a subroutine while also passing the same reference–that can cause a really nasty bug. I also fix a few more glitches called out by the standard checking in PyCharm. That is why I like PyCharm. I love standards–the code usually runs better and safer when all cleaned-up. I love it when it points out what is likely a typo on my part.

I take a break from chess and Python and buy groceries from the local Safeway. I get the basics (except I thought we had milk! What only three eggs!) and lots of holiday nuts and chocolate-covered stuff—Susie like that for the holidays. I also put up Susie’s Peanuts Holliday dancing and musical collection. So we are trying to get “Christmas-ee.”

I cook sweet Italian Sauage in a tomato cream sauce over pasta for dinner. It was just OK.

Susie is reading. I am coding more Python. Even when it is so stupid, the chess program noticed that I misplaced a knight and took it. That made me smile. I also revised the pawn setting matrix to like the center and the end of the board more. I set the values higher for just pawns, making the program detect that moving a pawn to the center is more valuable than sending a knight there. The program was bouncing knights all over the board before–it was bizarre looking moves. The pawns are now moving out better.

I am having a problem with exchanges in the chess program. The program runs away from nearly equal exchanges! It was odd to drive the king out with a check that should have been a pawn taking my bishop. Again, the pawn matrix change is now getting back at me, and the piece values are set too low. I have more fun chess coding coming up when I get some free time again.

It has been fun to get back into chess again.

Last year this weekend, we, Susie Corwin and me, flew to Amsterdam. We are missing the traveling and the holidays in Europe we so enjoyed last year. We look forward to returning to Amsterdam in 2021 or 2022. Rome is the penciled-in plan for October 2021.

1,414 people are reported to have died today in the USA from the virus.

Maybe it is early for this one, but I thought it was time for this: Joy to the World.


2 thoughts on “Day 282: Sunday Chess”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s