2020年12月21日星期一

convert RLE into a list of coordinates

I want to convert an RLE, or Run-length encoding file into a list of coordinates which represent live cells like this: [(x,y),(x,y),(x,y)] I tried reading this but it didn't really explain how to do what I want. how can I do this?

here is an example:

obo$b2o$bo! -> [(0,0),(1,1),(1,2),(0,2),(2,1)]

https://stackoverflow.com/questions/65402667/convert-rle-into-a-list-of-coordinates December 22, 2020 at 10:52AM

没有评论:

发表评论