Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can't you just use mod(x, 1:n)? Or mod(i, eachindex(vals))?


Lol, this is so nice. It is literally what OP asked for: " modulo to remain within some range" is just mod(myvalue, myrange)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: