Bad AI. Bad, bad AI.

OK, looked at the code it generated - it's fundamentally wrong! It gets a number of spaces to go between each word but then doesn't use it, just putting one space between each word, plus one if the gap number is < the remainder (see the prompt below). So it'll never be right. It compounds it by putting padding (spaces) at the end of the line, which is completely the opposite of the assignment!