I could have use this when I was trying to use entmake and couldn't figure out what codes needed to be there. I just thought of this today, and have one way, non-recursive, and thought it might be a fun little challenge. I don't think mine works quite right as is, as I think there are some codes that are shown, but don't need to be there.
Rules:
The functions will return the minimum codes to create an entity like the one supplied. What is supplied to the function can be either the entity, or the entities dxf code list. Mine takes the code list.
Edit: Change the title to clarify some confusion.