diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | src/main.c | 4 | ||||
| -rw-r--r-- | src/mastur.c | 7 | 
3 files changed, 11 insertions, 1 deletions
@@ -15,6 +15,7 @@ SRC := src/bigtab.c \         src/new32.c \         src/new32v2.c \         src/new32v3.c \ +       src/mastur.c \         src/null.c \         src/ref.c @@ -21,6 +21,7 @@ int new(int i, int x, int y);  int new32(int i, int x, int y);  int new32v2(int i, int x, int y);  int new32v3(int i, int x, int y); +int mastur(int i, int x, int y);  void bigtab_init(void);  int bigtab(int i, int x, int y); @@ -40,7 +41,8 @@ static struct solfunc solfuncs[ ] = {  	{"new", new},  	{"new32", new32},  	{"new32v2", new32v2}, -	{"new32v3", new32v3} +	{"new32v3", new32v3}, +	{"mastur", mastur}  };  #define PASSES 5 diff --git a/src/mastur.c b/src/mastur.c new file mode 100644 index 0000000..7826b05 --- /dev/null +++ b/src/mastur.c @@ -0,0 +1,7 @@ +static const int A[] = {0, 1, -1}; +static const int C[][3] = {{1, 1, -2}, {1, 1, -2}, {-2, 1, 1}}; + +int mastur(const int i, const int x, const int y) +{ +	return i + A[x] * C[x][i / y % 3] * y; +}  | 
