@@ -9,6 +9,17 @@ sort: 8
9From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
9From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
12def n(def a) {
23def n(def a) {
13 if (a in List) {
24 if (a in List) {
14 if (a.size() == 1) {
25 if (a.size() == 1) {
@@ -20,15 +31,15 @@ def n(def a) {
21 throw new IllegalStateException()
32 throw new IllegalStateException()
23− } else if (a in Integer && a >= 0) {
34+ } else if (i(a)) {
26 throw new IllegalStateException()
37 throw new IllegalStateException()
30def wut(def a) {
41def wut(def a) {
31− a in Integer ? 1 : 0
42+ i(a) ? 1 : 0
34def lus(def a) {
45def lus(def a) {
@@ -50,7 +61,7 @@ def fas(def a) {
50 throw new IllegalStateException()
61 throw new IllegalStateException()
52 def h = a[0]
63 def h = a[0]
53− if (!(h in Integer)) {
64+ if (!i(h)) {
54 throw new IllegalStateException()
65 throw new IllegalStateException()
56 def t = a[1]
67 def t = a[1]
@@ -59,18 +70,19 @@ def fas(def a) {
59 } else if (h == 1) {
70 } else if (h == 1) {
62− if (t in Integer) {
73+ if (i(t)) {
63 throw new IllegalStateException()
74 throw new IllegalStateException()
64− } else if (h == 2) {
76+ if (h == 2) {
66 } else if (h == 3) {
78 } else if (h == 3) {
69− def i = h.intdiv(2)
81+ def x = h.intdiv(2)
70 if (h.mod(2) == 0) {
82 if (h.mod(2) == 0) {
71− fas([2, fas([i, t])])
83+ fas([2, fas([x, t])])
73− fas([3, fas([i, t])])
85+ fas([3, fas([x, t])])