summaryrefslogtreecommitdiff
path: root/src/mastur.c
blob: 39f868d995bb63a6b19c5373bd4071cdd708035f (plain)
1
2
3
4
5
6
static const int C[][3] = {{0, 0, 0}, {1, 1, -2}, {2, -1, -1}};

int mastur(const int i, const int x, const int y)
{
	return i + C[x][i / y % 3] * y;
}