This could be useful for the fractalplotr package. For example for generating sierpinski triangles. But also more organic shapes or maybe semi-random art.
Don't save the lines as lists. Keep one vector for x and one for y and insert NA to force line breaks when loading state.
Don't save the states separately. Just keep a recort of every x and y and direction and when saving save the index inside those vectors. Then load the value from that index when loading state.
This could be useful for the fractalplotr package. For example for generating sierpinski triangles. But also more organic shapes or maybe semi-random art.