How to specify who's turn it is in SGF file?

I’m working on some software that will output an SGF file. I figured out how to setup stones for each color. Now I’m trying to specify who’s turn it is. What is the syntax in SGF to specify whether it is white or black’s turn?

The PL property is use to set who’s turn it is

See in the SGF specification here: SGF properties (FF[4])

2 Likes

Thanks for responding. How do I use the PL property? Do I need [] after it? And what goes in the brackets? Also, where does this property go? Does it need to be inside parentheses of a node?

I tried it like this:

(;FF[4]
GM[1]
;AB[bp][bq][cq][dd][dq][eb][ec][ed][ef][ei][ej][er][fj][fr][gk][gm][hk][jd][jn][kl][km][le][lf][lh][lk][mj][mq][nc][nr][oh][oq][os][pd][pn][pp][pq][qd][qh][ql][rd][rf][rg][ri][sh]
;AW[bc][be][bf][bo][cd][ci][cm][cp][db][dc][dp][em][eq][fh][fi][fk][fn][fq][gj][gp][gr][hj][in][jl][jp][kj][kk][md][me][mf][mm][mp][mr][nh][no][np][nq][oi][op][pf][ph][qe][qf][qg][qi][qj][rj]PL[W]
)

I paste it to my SGF library on OGS and then go to analyze the game, but it wants to place a black stone, not a white one: undefined vs. undefined

By clicking on rhe titlebar you get

https://www.red-bean.com/sgf/index.html

There there is a link to more general guides, like a user guide.
Hope it helps