Vom Prinzip her:

while(x>5)
{
x=x-6
}
modulo=x

Dann den Wert noch +1, dann haste ne zahl von 1-6