Computers are, of course, not capable of writing poetry. Language can be used with (almost) correct syntax, but semantics, the meaning, is a serious problem for a computer.
And even more so verse, in which the symbiosis of form and meaning has even more importance than in prose.
Given a little luck and a small program, a computer can nevertheless produce little "verses".
And luck is certainly needed because chance plays an important role in this "poetry" program.
Years ago, I used this as an example in the "Basic cookery lessons" of the
Philips & MBLE P 2000 - MC 11 Microcomputer User's Instruction Handbook
(View of the cover and front page - a new window will be opened)
published in Antwerp, Standaard Publishing Company, 1986. And I still like the idea.