Devi usare un contatore che sia azzerato quando non sei a mercato, mentre quando lo sei inizi a contare partendo da 1 e ricominci da capo se manca la consecutività. Prova questo (non l’ho testato):
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.