The biggest problem with your code is the use of global variables. This is typically a bad thing as it makes reuse and modification of your code harder later. While in a trivial program it may seem ok ...
Cuireadh roinnt torthaí i bhfolach toisc go bhféadfadh siad a bheith dorochtana duit
Taispeáin torthaí dorochtana