If you have cats you may recognize the purpose if this right away; cats HATE to be locked in or out of a room and they often will scratch at the carpet to try to get out. I don't think they're stupid enough to think they can tunnel out... I actually think they're so smart they know if they damage the property you'll probably do anything to get them to stop, including let them in or out!
This is another Dollar Store Crafts contest entry. All I did was measure the thickness of the door frame (14 cm), and it's distance from the wall (11 cm), and cut the carpet square accordingly. I found that on the inside edge it needed an angled line, so I cut from the corner to a space about a centimeter further out and it fit perfectly. Bonus: even if you have to buy EVERYTHING it will still only cost $4 plus tax! Everything is available at the Dollar Tree.
An unbound carpet square
An Exacto knife
A permanent marker