News for hackers. Stuff that matters.
Re:TerrariaClone – An incomprehensible hellscape of spaghett... by danbruc on Thursday October 12, 2017 @06:29PM (#15461819)
That is probably (x + 1) % 10 assuming x is non-negative. That kind of code is responsible for quite a bit of the verbosity, the author was obviously not aware of many of the little tricks usually used in this kind of code.
Re:TerrariaClone – An incomprehensible hellscape of spaghett... by raxod502 on Thursday October 12, 2017 @08:53PM (#15462580)
Original author here.

It's actually a method to convert from the index of an inventory hotkey slot into the keystroke used to access it -- there were ten hotkey slots, which were numbered 1–9 and 0 at the end.

But I like all the other interesting interpretations here :P (They all assume way more knowledge than I had at the time.)

Re:TerrariaClone – An incomprehensible hellscape of spaghett... by baddox on Thursday October 12, 2017 @08:29PM (#15462486)
Also assuming that x <= 9.