~rabbits/dito

4cf5222b3a42f47942cc7eab81eaf5e1fba17e1e — neauoire 2 years ago 53b07fe
Pattern takes 0&3 colors
1 files changed, 3 insertions(+), 3 deletions(-)

M dito.c
M dito.c => dito.c +3 -3
@@ 235,11 235,11 @@ int
getpattern(int palette, int x, int y)
{
	if(palette == 3)
		return 1;
		return 3;
	if(palette == 2)
		return ((x + y) % 2) == 0 && ((y - x) % 2) == 0;
		return ((x + y) % 2) == 0 && ((y - x) % 2) == 0 ? 3 : 0;
	if(palette == 1)
		return ((x + y) % 4) == 0 && ((y - x) % 4) == 0;
		return ((x + y) % 4) == 0 && ((y - x) % 4) == 0 ? 3 : 0;
	return 0;
}