Since this tutorial only focuses on the capabilites of the Kafka eco system and not on deployment concepts I did not deep dived into the vairous deployment options and configuration. Of course the demo is not production-ready demo in any means.
If you want to support the sceanio with 3 node you will need to revisit the code in such as way that is similiar to the helm charts published by confluent , lets take for example the file here :
where you can see they are concating the Broker ID to the IP Address, e.g :
EXTERNAL://${HOST_IP}:$((31090 + ${KAFKA_BROKER_ID}))
this way you are using some "formula" combined of start Port + Broker ID.