Thursday, September 3, 2020

Chess Flashcards

Introduction

I've heard the advice from a few people now: "I made flashcards for my chess games/tactics and study them!" 

I always wondered how they did this, if they cut their chess books up and pasted positions on actual cards, if they had some software that did it automatically, if they drew pictures....

I heard Stacia Pugh on an episode of Perpetual Chess Podcast and that's when I finally decided to give it a try. Give that episode, and the podcast in general, a listen. It's great! She sold her method really well and it fits in with my "customize your training" perspective. I then saw a video on her chess.com blog of her running through a flashcard session and I began getting a picture of how it worked. After playing with Anki, which is a spaced repetition flashcard software, I settled on a system that's great for my learning style. 

If you just wanna learn how to set it up, skip to the bottom section.

Before going into the benefits I see in this training method, here's a quick example of what the setup looks like mid-session:


That should give you an idea. The board position in the flashcard is a static screenshot from a game of mine with a question--often it's a multi-part question--that I must answer before I move on. I cannot click anywhere and move any pieces even though there are anki add-ons and tools you can install to do such a thing (Side-note: They may not work on the newer version but that doesn't matter for this anyway). I wanted to stick with old school static images with an "essay question"-style prompt. When I click "Show Answer", the solution I provide usually consists of several sentences of text with the answer and other things to consider along with a link to the game for further analysis if I want. That comes in handy a lot.

I started off a deck of cards with all kinds of positions: opening mistakes, tactics, endgame technique, and middlegame strategy. After doing that for a week, I decided to focus on just openings so I made a deck just for that. You might want to consider grouping yours as well. Just note that the rest of my post will be regarding my Openings deck. 


Reasons I Think it's a Good Method

  • It forces you to see games as opportunities to learn. After a loss, my morale might be a little down but once I start working on collecting a screenshot or two, the loss is less painful and I get excited about figuring out the reasons why my bad moves were bad and what I can change.
  • The system requires you to analyze your games. If you want more flashcards, you have to go back through the game. If you often find yourself quickly going to the next game, this system slows you down if you are committed to making flashcards from the game that just happened. Alternatively, if you have ladder anxiety and have an urge to preserve your precious rating points or whatever, this system can help you frame games as an opportunity for a flashcard harvest: "Fuck I just lost three in a row...welp at least I got some fresh-ass positions to learn"
  • If you play the same openings, you'll be surprised how often the positions from your flashcards make appearances in your games.
  • It uses positions from your own personal games so it's going to be full of positions in openings you like to play featuring common moves that players at your level play!
  • Customized learning methods work much better for me and I'm more likely to stick with them compared with downloading an app and using it for two days then forgetting about it. Although this method requires slightly more work and time investment, you'll learn to get pretty fast at it (see the section later where I briefly walk through making a deck)
  • Explaining moves and concepts in your own words shows better understanding than simply making moves in an app. I'm interested in being able to explain the reasons why a move is good or bad in the opening and point out other key aspects in the position besides. For me, this is far better than: "What move do you play here?" that is prevalent in apps. 
  • It's flexible. I can have questions about tactical tricks, common early queen moves, why a move is sub-optimal, common moves I play that are wrong and I have to answer why, etc. I can customize it to problems I see in my own games.
  • It's adjustable. If I'm working through my deck and I notice something I didn't before, I can quickly edit the card or solution to reflect what I just noticed. Sometimes I make an entirely new card from the same position with a new prompt. This often involves adding in a visualization exercise: If I'm looking at an old card and I see a tricky tactic if black plays sub-optimally, I find that position in my image directory, copy it and replace the prompt with "Visualization exercise: What does black play if 1. Nc3 Nf6 2. Qa4+ Nbd7 3. Bg5?"


Reasons It's Not a Great Method

  • It is time consuming. Let's say I'm going back over the game and you start a stopwatch from the time I notice a position I want to turn into a flashcard, I would guess that it takes 3 to 5 minutes to turn that into a final card imported into my Anki deck ready for study. So if I make three cards from a game, it might be 15 minutes of "paperwork" but in my opinion that is worth it for what I get in return. For others, that's not worth the time so that's to be considered. I want to add that you might be surprised how fast you develop a system of making cards, however.
  • It's simply not for everyone. Some players might require or do better with dynamic boards where you can see engine evaluations, see the moves played on the board, and immediately see best-move continuations. Or they try it once and decide they're not gonna fuck with making these damn cards! Totally fair.
  • . . .
  • SHOCKING: there's only two items here for something I've invested a fair amount of time and effort in ;) I'll just say that if this method interests you, give it a shot and see what you think of it. 


Brief Tutorial on Setup (for Windows, but probably similar for Macs?)

Anki is awesome free software that a lot of college and grad students use to memorize things using a spaced repetition structure. It is widely used as a text-based study aid but there are ways to import images and even sound. I've found a simple method to import chess positions with a small amount of effort. I've lately wondered if, perhaps for someone with more time on their hands, they could work with the chessvision bot from /r/chess to automate more of this but my screenshot system is fine for me.

Essentially you screenshot the board position, crop it and add a prompt, save it to a particular directory, and finally set up an import file with the image pathname and a solution to the position. A few clicks in Anki and it'll be there for you!

I'll briefly outline how to do that but if any reader wants more specific information, I can try to help in comments or on reddit!

1. Take screenshot of position of interest.

2. Paste in MSPaint. Crop off any border and then add some whitespace at the bottom where you'll type in a question about the position that you want to test yourself on when you are studying.

3. Save the image in a folder called collection.media that Anki made during install. On my machine, the folder is located at C:\Users\_____\AppData\Roaming\Anki2\User 1\collection.media

4. I use a numbered system to save image, starting with 001.png. You'll want something easy to remember and put in order.

5. In collection.media, make a text file and call it importer.txt. Open importer.txt with notepad. This .txt is going to have paths to chess images and then answers that accompany each. In the import step, you'll direct Anki to this file.

6. In importer.txt, type out a line as below that points to your image and then type out an answer that you want displayed. For my image titled 001.png which has a solution of "White should play Bxe7" (my solutions are typically much more verbose), I would put the following in the importer.txt:

    "<img src=""/openings/001.png"">"; White should play Bxe7

--Notice the semi-colon. That's your separator/delimiter. That will tell Anki that after the semi-colon it is the beginning of a second field, i.e. your solution field that will display when you click "Show Answer" in the program. Make sure to not use semi-colons anywhere in your importer.txt except to separate fields. You can really use most any character I think. I tried commas for a while but that doesn't work well if you are a fan of using commas in your answer fields.

--And I believe the double quotes are necessary otherwise it won't import properly. 

7. Save the importer.txt.

8. In Anki, you should now be able to click File > Import > Select your importer.txt. Choose Fields separated by Semi-Colon (or whichever character you used). And check Allow HTML in fields. I wasn't doing that step at first and that's what got me. Make sure you have a front and back assigned properly and try importing it!

9. Study your deck and see if it works!

--To Troubleshoot where things might be going wrong, try things like importing simple text so instead of image pathnames, just trying a simple "What is your name?" and put in an answer and see if it imports. Also do what I did and google it ;) 

You obviously can and should put many images in your folder and your importer.txt will grow as you play more games and accumulate more flashcards. Presumably you can import a very large number of images, my current one has nearly fifty and I'm hoping for hundreds eventually. Simply beginning a new line with the next image pathname + solution is all you need. To help organize, I put my flashcards in a folder called "openings" within the collections.media folder.  Here's a basic example of importer.txt with three images in it:

    "<img src=""/openings/001.png"">"; White should play Bxe7

    "<img src=""/openings/002.png"">"; Long-winded solution

    "<img src=""/openings/003.png"">"; Blah-blah, yet another long-winded solution


Good luck!

1 comment:

  1. Nice article and summary of pros and cons. I use similar methods to study chess and built some automation tools that work with Anki. You can check them out here:
    https://www.chessflashcards.com

    ReplyDelete

My SECOND OTB Tournament Experience!

Allright, it's time for another tournament! Six months since my last one, no thanks to a certain variant of a certain virus which shall ...