Advertisement
NaZaRa

Random fast-growing function

Mar 29th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. int h(int a, int b, int c, int k) {
  2.     if (a == 0) {
  3.         if (b == 0) {
  4.             if (c == 0)   return k+1;
  5.             else          return h(a, b, c-1,    k*(c+k+1)+k+1         );
  6.         }
  7.         if (c == 0) return h(a, b-1, k+1,        k*(b+k+1)+k+1         );
  8.         /*default*/ return h(a, b-1, h(a,b,c-1,k+1), k*(b+k+1)*(c+k+1)+k+1 );
  9.     }
  10.     if (b == 0) return h(a-1, k+1, c,       k*(a+k+1)*(c+k+1)+k+1         );
  11.     if (c == 0) return h(a,   b-1, k+1,         k*(a+k+1)*(b+k+1)+k+1         );
  12.     /*default*/ return h(a,   b-1, h(a,b,c-1,k+1),  k*(a+k+1)*(b+k+1)*(c+k+1)+k+1 );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement