append_result: Append outcome of chess game to moves in standard algebraic...

View source: R/autoplay_game.R

append_resultR Documentation

Append outcome of chess game to moves in standard algebraic notation (SAN)

Description

The function append_result() is helper function for autoplay_game() that takes a string of chess moves in standard algebraic notation (SAN) as the argument. If the last character is # it checks to see which side won, and appends the appropriate result ("1-0" or "0-1"). If the last character is not #, it tests for stalemate or checkmate.

Usage

append_result(movetext)

Arguments

movetext

A string of chess moves in standard algebraic notation (SAN).

Value

A string of chess moves with the game result appended.


dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.