There's a way to slice the mainline like we slice lists on Python? For example:
- mainline[start:stop] # moves start through stop-1
- mainline[start:] # moves start through the rest of the mainline
- mainline[:stop] # moves from the beginning through stop-1
or
- mainline[start:stop:step] # start through not past stop, by step.
The idea is, having the main_sicilian
object:
1. e4 c5 2. b4 cxb4 3. d4 d5 4. e5 Nc6 5. a3 Qb6 6. Ne2 Bf5 7. axb4 Nxb4 8. Na3 Rc8 9. Nf4 Bxc2 10. Qg4 e6 *
I would like to have:
main_sicilian[1:5] = 1. e4 c5 2. b4 cxb4 3. d4 d5 4. e5 Nc6 5. a3 Qb6
Also, by defining where it would finish. For example, until white's 3rd move:
1. e4 c5 2. b4 cxb4 3. d4
I tried the documentation but I find it hard to use for a Python beginner.