lila icon indicating copy to clipboard operation
lila copied to clipboard

Analysis Board - Set moves with url parameter

Open labbeast89 opened this issue 2 years ago • 4 comments

We can already define in the URL what is the

  • FEN
  • Side of the board
  • Color of the board And so on

It would be really handy to have a parameter moves (or line) as someone expressed on reddit:https://www.reddit.com/r/lichess/comments/kollls/is_it_possible_to_pass_a_pgn_line_to_lichess_via/

Let me know if this is possible!

Keep up the good work!

labbeast89 avatar Aug 18 '22 17:08 labbeast89

@ornicar I saw your recent commit, can it be used with a FEN starting position? If so how? Thanks!

labbeast89 avatar Aug 18 '22 20:08 labbeast89

This feels like a duplicate of https://github.com/lichess-org/lila/issues/10205, so closing it for now. Feel free to comment/thumbs-up that issue.

As for how to use the current endpoint, you can do something like this:

https://lichess.org/analysis/pgn/1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6

brollin avatar Aug 18 '22 23:08 brollin

@ornicar I saw your recent commit, can it be used with a FEN starting position? If so how? Thanks!

https://lichess.org/analysis/4B3/2K5/3P4/2k5/8/7b/8/8_w_-_-_0_1

ornicar avatar Aug 29 '22 07:08 ornicar

@ornicar I saw your recent commit, can it be used with a FEN starting position? If so how? Thanks!

https://lichess.org/analysis/4B3/2K5/3P4/2k5/8/7b/8/8_w_-_-_0_1

I meant using both FEN and moves at the same time. Something like:

https://lichess.org/analysis/6k1/p5r1/8/3p1q2/2pP2P1/2P1PN2/PP4P1/R1BR2K1_b_-_-?pgn=1..._Qxg4_2._Rd2_Qxf3

So we use the following FEN as starting position: 6k1/p5r1/8/3p1q2/2pP2P1/2P1PN2/PP4P1/R1BR2K1

And the following pgn as moves: 1... Qxg4 2. Rd2 Qxf3

labbeast89 avatar Aug 29 '22 17:08 labbeast89

If all you want to do is specify color in combination with the PGN then you can do this: https://lichess.org/analysis/pgn/{PGN}?color=black For example: https://lichess.org/analysis/pgn/1.%20d4%20d5%202.%20c4?color=black

olleeriksson avatar Nov 21 '22 19:11 olleeriksson