The main purpose of the chesstrainer package is to create sequences of moves (lines), save them, and then test yourself on these sequences. This is especially useful for training openings, but can also be used for creating chess puzzles or training tactics. Can you find the forced mate below?

The development version of the chesstrainer package can be installed with:
install.packages("remotes")
remotes::install_github("wviechtb/chesstrainer")To start playing, first load the package with library(chesstrainer) and then type: play(). For an introduction, type: help(chesstrainer) or you can read the documentation online here.
If you are not an R user, but still would like to use the trainer, you will first have to install R, which is freely available from the Comprehensive R Archive Network. Once R is installed, start up R and then enter the commands above for installing the package after the prompt (>) on the ‘R Console’. If you receive a prompt whether to use/create a personal library, answer ‘Yes’. If you are asked for a download location, you can select the first choice. Once the package is installed, type library(chesstrainer) to load the package and play() to start the trainer.
It is indeed unusual to write such an application in R, which is primarily a programming language for statistical computing and data visualization (you can read more about R on the R project homepage or on Wikipedia). While interactive applications have already been developed using external frameworks such as Shiny and Tcl/Tk, the chess trainer started as a proof-of-concept study to explore whether full-featured interactive applications could be built using ‘base R’ alone (i.e., relying exclusively on R’s built-in capabilities.)
After developing an early prototype and recognizing its potential, the project quickly spiraled out of control, eventually evolving into the current package, whose functionality is comparable to that of similar commercial offerings.
The chesstrainer package was written by Wolfgang Viechtbauer. is licensed under the GNU General Public License Version 3. To report any issues or bugs, please go here.