It was Sunday evening, CoderDojo takes place Fridays, so I had four nights for coding and one for writing the tutorial. I had implemented some other Scratch games before, which were all accompanied by step-by-step tutorials for children to re-create the programs on their own. Kochy-Richter checkmate detected by GoK - click image to view video The First Week - CoderDojo Linz Chess The GoK project started as a tutorial for the CoderDojo Linz Kids Programming Club. Other things like alpha/beta-pruning or quiescence search I picked up from there directly. So I still knew MiniMax from University (it's the logical approach for board games), and came up with some kind of move ordering (based on iterative deepening), square piece tables, mobility evaluation and attack tables myself - I just fine-tuned the crude original implementations later, after reading on and other places. My approach was to try different ideas, and only when I was stuck, I investigated about underlying chess programming theory in certain areas. So perfect, it was just the challenge I was looking for. And for the chess engine case, that just meant it was bit more difficult, and that no implementation would ever reach the playing strength of chess games on other platforms (BTW, running GoK on other Scratch engines like TurboWarp shows the performance potential: ). But that hasn't stopped people from writing pen-based 3D games in Scratch. regarding structured programming, there are no bitwise operations (hence no bitboard data structure), it is very slow and even has some performance throttling built in (so that kids wouldn't have to worry about timing). The language's capabilities are limited, esp. It was designed for other purposes - for simple games and animations, programmed by kids. In general, Scratch is probably the least suited programming and runtime environment to implement a chess engine. But luckily, I got help from others, and found valuable online material too. I should mention that I am not a good chess player, know next to nothing about chess in theory, and had only a basic idea about chess programming when I started the project. So, I decided to provide a forum posting on that topic, which might also trigger further discussion. How Game of Kings is implemented Hello Chess Players and Programmers! Over the last couple of months, several Scratch users have asked for more detailed info on how Scratch Chess - Game of Kings works internally.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |