Split the data into chunks, one chunk for each position.(Fun thing to do on a Saturday morning, right?) None of the chess software programs that I have can do this, so I decided to tackle it with MATLAB. I wanted to shuffle the positions in this file randomly. Can you figure out how White wins by capturing the Bishop on c8 with his rook? (If you're interested in how the position is encoded in the text, see the Wikipedia article on Forsyth-Edwards Notation, or FEN.) The first is the position I showed above, with White to move. Here are lines 2,759 through 2,784 from the file. I have a text file, tactics.pgn, that is a database of chess tactics puzzles. Even so, I thought the task would be a good illustration of some basic text processing techniques. This weekend I had such a task, although I must admit that it had nothing to do with engineering or science. It seems like a lot of computational tasks in engineering and science involve manipulating data in text files. Because this post is really about text processing. And that's about as close to image processing as today's blog post will come.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |