Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
my $ammo = 10;
sub updateUI { my ($ammo) = @_; print "Ammo: $ammo\n"; }
sub shoot { $ammo--; updateUI($ammo); }
sub reload { $ammo = 10; updateUI($ammo); }
# Simulate actions
updateUI($ammo);
shoot();
shoot();
reload();Coding works best on desktop or with an external keyboard.