You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Math.wrap doesn't alter the arguments, it just returns a wrapped value.

    As such Math.wrap(k++, 10); won't do anything - you'd probably want k=Math.wrap(k+1, 10);

    But as @MaBe says, for this kind of thing with just integers you could also easily use modulo: k=(k+1)%10;

About

Avatar for Gordon @Gordon started