A jury at Sheffield Crown Court was told there was no doubt that it was Ayaan Ali, 28, of Isleworth, Middlesex, who went on the rampage through Barnsley Town Centre. She stands charged with attempted murder, possessing an offensive weapon and affray.
Kate Batty, prosecuting, said the question for the jury in this case was whether Ali knew what she was doing, and whether she knew it was wrong.
The court was told that minutes after arriving in town via the interchange, Ali stabbed Andrew Froggatt and chased him for around 100m through the town centre before turning her attention on window cleaner Mark Watson.
She tried to stab him, telling him 'you're a male prostitute, I'm going to kill you'. Mr Watson entangled her in a tarpaulin from a market stall and used his bucket to defend himself.
A bank worker, the court was told, described seeing Ali running around Peel Square shouting, 'kill, kill, kill' and muttering.
She was later arrested at the transport interchange around 30 minutes after she arrived in the town centre.
The trial continues.