tx · 5a9Fdq1oYdfEMdQPfTkopnA5nzKR8EmSJYqAUtP4ukmb 3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs: -0.01400000 Waves 2019.07.31 20:23 [610565] smart account 3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs > SELF 0.00000000 Waves
{ "type": 13, "id": "5a9Fdq1oYdfEMdQPfTkopnA5nzKR8EmSJYqAUtP4ukmb", "fee": 1400000, "feeAssetId": null, "timestamp": 1564593794330, "version": 1, "sender": "3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs", "senderPublicKey": "GL5QvqgydTUCg1sj1s7juR6hVfxLHjZ37Kr5sAX4D4an", "proofs": [ "5bK4QzopiLu64HjSjXf81hYMe88jykWttokWxRYe12UCYB6iadChLgQJbRawJjMHyvZphWLzxdHtPz6hdK91LuZ3" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAQAAAAlmaXZlQ2hhcnMAAAABAAAAAWMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAABYwUAAAABYwUAAAABYwUAAAABYwUAAAABYwEAAAAEY2VsbAAAAAMAAAAFY2VsbHMAAAADcm93AAAAA2NvbAkBAAAACXRha2VSaWdodAAAAAIJAAEvAAAAAgUAAAAFY2VsbHMJAABkAAAAAgkAAGQAAAACCQAAaAAAAAIFAAAAA3JvdwAAAAAAAAAADwUAAAADY29sAAAAAAAAAAABAAAAAAAAAAABAQAAAAdzZXRDZWxsAAAABAAAAAVjZWxscwAAAANyb3cAAAADY29sAAAAA3ZhbAkAASwAAAACCQABLAAAAAIJAAEvAAAAAgUAAAAFY2VsbHMJAABkAAAAAgkAAGgAAAACBQAAAANyb3cAAAAAAAAAAA8FAAAAA2NvbAUAAAADdmFsCQEAAAAJdGFrZVJpZ2h0AAAAAgUAAAAFY2VsbHMJAABlAAAAAgkAATEAAAABBQAAAAVjZWxscwkAAGQAAAACCQAAZAAAAAIJAABoAAAAAgUAAAADcm93AAAAAA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dwUAAAADY29sBQAAAAN2YWwJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAVnYW1lOgkAAaQAAAABBQAAAARnYW1lAgAAAAZfY2VsbHMFAAAACG5ld0NlbGxzBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABkWsaeM=", "chainId": 84, "height": 610565, "spentComplexity": 0 } View: original | compacted Prev: 9m3nAFS9QhSYfVcL4yU5FsZDxKMD3dCf5ERc8q7uaXKM Next: ANj88AXt6e7tyDub3tSmHrkPCAoK2YXnxdQZbPLgBAe Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | - | func getRow (cells,row,col) = (((((((((if ((col >= 4)) | |
26 | - | then cell(cells, row, (col - 4)) | |
27 | - | else "") + (if ((col >= 3)) | |
28 | - | then cell(cells, row, (col - 3)) | |
29 | - | else "")) + (if ((col >= 2)) | |
30 | - | then cell(cells, row, (col - 2)) | |
31 | - | else "")) + (if ((col >= 1)) | |
32 | - | then cell(cells, row, (col - 1)) | |
33 | - | else "")) + cell(cells, row, col)) + (if ((13 >= col)) | |
34 | - | then cell(cells, row, (col + 1)) | |
35 | - | else "")) + (if ((12 >= col)) | |
36 | - | then cell(cells, row, (col + 2)) | |
37 | - | else "")) + (if ((11 >= col)) | |
38 | - | then cell(cells, row, (col + 3)) | |
39 | - | else "")) + (if ((10 >= col)) | |
40 | - | then cell(cells, row, (col + 4)) | |
41 | - | else "")) | |
42 | - | ||
43 | - | ||
44 | - | func getColumn (cells,row,col) = (((((((((if ((row >= 4)) | |
45 | - | then cell(cells, (row - 4), col) | |
46 | - | else "") + (if ((row >= 3)) | |
47 | - | then cell(cells, (row - 3), col) | |
48 | - | else "")) + (if ((row >= 2)) | |
49 | - | then cell(cells, (row - 2), col) | |
50 | - | else "")) + (if ((row >= 1)) | |
51 | - | then cell(cells, (row - 1), col) | |
52 | - | else "")) + cell(cells, row, col)) + (if ((13 >= row)) | |
53 | - | then cell(cells, (row + 1), col) | |
54 | - | else "")) + (if ((12 >= row)) | |
55 | - | then cell(cells, (row + 2), col) | |
56 | - | else "")) + (if ((11 >= row)) | |
57 | - | then cell(cells, (row + 3), col) | |
58 | - | else "")) + (if ((10 >= row)) | |
59 | - | then cell(cells, (row + 4), col) | |
60 | - | else "")) | |
61 | - | ||
62 | - | ||
63 | - | func getRDiag (cells,row,col) = (((((((((if (if ((row >= 4)) | |
64 | - | then (10 >= col) | |
65 | - | else false) | |
66 | - | then cell(cells, (row - 4), (col + 4)) | |
67 | - | else "") + (if (if ((row >= 3)) | |
68 | - | then (11 >= col) | |
69 | - | else false) | |
70 | - | then cell(cells, (row - 3), (col + 3)) | |
71 | - | else "")) + (if (if ((row >= 2)) | |
72 | - | then (12 >= col) | |
73 | - | else false) | |
74 | - | then cell(cells, (row - 2), (col + 2)) | |
75 | - | else "")) + (if (if ((row >= 1)) | |
76 | - | then (13 >= col) | |
77 | - | else false) | |
78 | - | then cell(cells, (row - 1), (col + 1)) | |
79 | - | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
80 | - | then (col >= 1) | |
81 | - | else false) | |
82 | - | then cell(cells, (row + 1), (col - 1)) | |
83 | - | else "")) + (if (if ((12 >= row)) | |
84 | - | then (col >= 2) | |
85 | - | else false) | |
86 | - | then cell(cells, (row + 2), (col - 2)) | |
87 | - | else "")) + (if (if ((11 >= row)) | |
88 | - | then (col >= 3) | |
89 | - | else false) | |
90 | - | then cell(cells, (row + 3), (col - 3)) | |
91 | - | else "")) + (if (if ((10 >= row)) | |
92 | - | then (col >= 4) | |
93 | - | else false) | |
94 | - | then cell(cells, (row + 4), (col - 4)) | |
95 | - | else "")) | |
96 | - | ||
97 | - | ||
98 | - | func getLDiag (cells,row,col) = (((((((((if (if ((row >= 4)) | |
99 | - | then (col >= 4) | |
100 | - | else false) | |
101 | - | then cell(cells, (row - 4), (col - 4)) | |
102 | - | else "") + (if (if ((row >= 3)) | |
103 | - | then (col >= 3) | |
104 | - | else false) | |
105 | - | then cell(cells, (row - 3), (col - 3)) | |
106 | - | else "")) + (if (if ((row >= 2)) | |
107 | - | then (col >= 2) | |
108 | - | else false) | |
109 | - | then cell(cells, (row - 2), (col - 2)) | |
110 | - | else "")) + (if (if ((row >= 1)) | |
111 | - | then (col >= 1) | |
112 | - | else false) | |
113 | - | then cell(cells, (row - 1), (col - 1)) | |
114 | - | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
115 | - | then (13 >= col) | |
116 | - | else false) | |
117 | - | then cell(cells, (row + 1), (col + 1)) | |
118 | - | else "")) + (if (if ((12 >= row)) | |
119 | - | then (12 >= col) | |
120 | - | else false) | |
121 | - | then cell(cells, (row + 2), (col + 2)) | |
122 | - | else "")) + (if (if ((11 >= row)) | |
123 | - | then (11 >= col) | |
124 | - | else false) | |
125 | - | then cell(cells, (row + 3), (col + 3)) | |
126 | - | else "")) + (if (if ((10 >= row)) | |
127 | - | then (10 >= col) | |
128 | - | else false) | |
129 | - | then cell(cells, (row + 4), (col + 4)) | |
130 | - | else "")) | |
131 | - | ||
132 | - | ||
133 | 25 | func checkField (cells,c,row,col) = { | |
134 | - | let targetLines = ((((((getRow(cells, row, col) + "|") + getColumn(cells, row, col)) + "|") + getRDiag(cells, row, col)) + "|") + getLDiag(cells, row, col)) | |
26 | + | let targetLines = ((((((((((((((((((((((((((((((((((((if ((col >= 4)) | |
27 | + | then cell(cells, row, (col - 4)) | |
28 | + | else "") + (if ((col >= 3)) | |
29 | + | then cell(cells, row, (col - 3)) | |
30 | + | else "")) + (if ((col >= 2)) | |
31 | + | then cell(cells, row, (col - 2)) | |
32 | + | else "")) + (if ((col >= 1)) | |
33 | + | then cell(cells, row, (col - 1)) | |
34 | + | else "")) + cell(cells, row, col)) + (if ((13 >= col)) | |
35 | + | then cell(cells, row, (col + 1)) | |
36 | + | else "")) + (if ((12 >= col)) | |
37 | + | then cell(cells, row, (col + 2)) | |
38 | + | else "")) + (if ((11 >= col)) | |
39 | + | then cell(cells, row, (col + 3)) | |
40 | + | else "")) + (if ((10 >= col)) | |
41 | + | then cell(cells, row, (col + 4)) | |
42 | + | else "")) + (if ((row >= 4)) | |
43 | + | then cell(cells, (row - 4), col) | |
44 | + | else "")) + (if ((row >= 3)) | |
45 | + | then cell(cells, (row - 3), col) | |
46 | + | else "")) + (if ((row >= 2)) | |
47 | + | then cell(cells, (row - 2), col) | |
48 | + | else "")) + (if ((row >= 1)) | |
49 | + | then cell(cells, (row - 1), col) | |
50 | + | else "")) + cell(cells, row, col)) + (if ((13 >= row)) | |
51 | + | then cell(cells, (row + 1), col) | |
52 | + | else "")) + (if ((12 >= row)) | |
53 | + | then cell(cells, (row + 2), col) | |
54 | + | else "")) + (if ((11 >= row)) | |
55 | + | then cell(cells, (row + 3), col) | |
56 | + | else "")) + (if ((10 >= row)) | |
57 | + | then cell(cells, (row + 4), col) | |
58 | + | else "")) + (if (if ((row >= 4)) | |
59 | + | then (10 >= col) | |
60 | + | else false) | |
61 | + | then cell(cells, (row - 4), (col + 4)) | |
62 | + | else "")) + (if (if ((row >= 3)) | |
63 | + | then (11 >= col) | |
64 | + | else false) | |
65 | + | then cell(cells, (row - 3), (col + 3)) | |
66 | + | else "")) + (if (if ((row >= 2)) | |
67 | + | then (12 >= col) | |
68 | + | else false) | |
69 | + | then cell(cells, (row - 2), (col + 2)) | |
70 | + | else "")) + (if (if ((row >= 1)) | |
71 | + | then (13 >= col) | |
72 | + | else false) | |
73 | + | then cell(cells, (row - 1), (col + 1)) | |
74 | + | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
75 | + | then (col >= 1) | |
76 | + | else false) | |
77 | + | then cell(cells, (row + 1), (col - 1)) | |
78 | + | else "")) + (if (if ((12 >= row)) | |
79 | + | then (col >= 2) | |
80 | + | else false) | |
81 | + | then cell(cells, (row + 2), (col - 2)) | |
82 | + | else "")) + (if (if ((11 >= row)) | |
83 | + | then (col >= 3) | |
84 | + | else false) | |
85 | + | then cell(cells, (row + 3), (col - 3)) | |
86 | + | else "")) + (if (if ((10 >= row)) | |
87 | + | then (col >= 4) | |
88 | + | else false) | |
89 | + | then cell(cells, (row + 4), (col - 4)) | |
90 | + | else "")) + (if (if ((row >= 4)) | |
91 | + | then (col >= 4) | |
92 | + | else false) | |
93 | + | then cell(cells, (row - 4), (col - 4)) | |
94 | + | else "")) + (if (if ((row >= 3)) | |
95 | + | then (col >= 3) | |
96 | + | else false) | |
97 | + | then cell(cells, (row - 3), (col - 3)) | |
98 | + | else "")) + (if (if ((row >= 2)) | |
99 | + | then (col >= 2) | |
100 | + | else false) | |
101 | + | then cell(cells, (row - 2), (col - 2)) | |
102 | + | else "")) + (if (if ((row >= 1)) | |
103 | + | then (col >= 1) | |
104 | + | else false) | |
105 | + | then cell(cells, (row - 1), (col - 1)) | |
106 | + | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
107 | + | then (13 >= col) | |
108 | + | else false) | |
109 | + | then cell(cells, (row + 1), (col + 1)) | |
110 | + | else "")) + (if (if ((12 >= row)) | |
111 | + | then (12 >= col) | |
112 | + | else false) | |
113 | + | then cell(cells, (row + 2), (col + 2)) | |
114 | + | else "")) + (if (if ((11 >= row)) | |
115 | + | then (11 >= col) | |
116 | + | else false) | |
117 | + | then cell(cells, (row + 3), (col + 3)) | |
118 | + | else "")) + (if (if ((10 >= row)) | |
119 | + | then (10 >= col) | |
120 | + | else false) | |
121 | + | then cell(cells, (row + 4), (col + 4)) | |
122 | + | else "")) | |
135 | 123 | check(targetLines, c) | |
136 | 124 | } | |
137 | 125 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func fiveChars (c) = ((((c + c) + c) + c) + c) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func cell (cells,row,col) = takeRight(take(cells, (((row * 15) + col) + 1)), 1) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func setCell (cells,row,col,val) = ((take(cells, ((row * 15) + col)) + val) + takeRight(cells, (size(cells) - (((row * 15) + col) + 1)))) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func check (line,c) = if (if ((c != "b")) | |
14 | 14 | then (c != "w") | |
15 | 15 | else false) | |
16 | 16 | then throw("invalid color in check function") | |
17 | 17 | else match indexOf(line, fiveChars(c)) { | |
18 | 18 | case _: Int => | |
19 | 19 | true | |
20 | 20 | case _ => | |
21 | 21 | false | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | - | func getRow (cells,row,col) = (((((((((if ((col >= 4)) | |
26 | - | then cell(cells, row, (col - 4)) | |
27 | - | else "") + (if ((col >= 3)) | |
28 | - | then cell(cells, row, (col - 3)) | |
29 | - | else "")) + (if ((col >= 2)) | |
30 | - | then cell(cells, row, (col - 2)) | |
31 | - | else "")) + (if ((col >= 1)) | |
32 | - | then cell(cells, row, (col - 1)) | |
33 | - | else "")) + cell(cells, row, col)) + (if ((13 >= col)) | |
34 | - | then cell(cells, row, (col + 1)) | |
35 | - | else "")) + (if ((12 >= col)) | |
36 | - | then cell(cells, row, (col + 2)) | |
37 | - | else "")) + (if ((11 >= col)) | |
38 | - | then cell(cells, row, (col + 3)) | |
39 | - | else "")) + (if ((10 >= col)) | |
40 | - | then cell(cells, row, (col + 4)) | |
41 | - | else "")) | |
42 | - | ||
43 | - | ||
44 | - | func getColumn (cells,row,col) = (((((((((if ((row >= 4)) | |
45 | - | then cell(cells, (row - 4), col) | |
46 | - | else "") + (if ((row >= 3)) | |
47 | - | then cell(cells, (row - 3), col) | |
48 | - | else "")) + (if ((row >= 2)) | |
49 | - | then cell(cells, (row - 2), col) | |
50 | - | else "")) + (if ((row >= 1)) | |
51 | - | then cell(cells, (row - 1), col) | |
52 | - | else "")) + cell(cells, row, col)) + (if ((13 >= row)) | |
53 | - | then cell(cells, (row + 1), col) | |
54 | - | else "")) + (if ((12 >= row)) | |
55 | - | then cell(cells, (row + 2), col) | |
56 | - | else "")) + (if ((11 >= row)) | |
57 | - | then cell(cells, (row + 3), col) | |
58 | - | else "")) + (if ((10 >= row)) | |
59 | - | then cell(cells, (row + 4), col) | |
60 | - | else "")) | |
61 | - | ||
62 | - | ||
63 | - | func getRDiag (cells,row,col) = (((((((((if (if ((row >= 4)) | |
64 | - | then (10 >= col) | |
65 | - | else false) | |
66 | - | then cell(cells, (row - 4), (col + 4)) | |
67 | - | else "") + (if (if ((row >= 3)) | |
68 | - | then (11 >= col) | |
69 | - | else false) | |
70 | - | then cell(cells, (row - 3), (col + 3)) | |
71 | - | else "")) + (if (if ((row >= 2)) | |
72 | - | then (12 >= col) | |
73 | - | else false) | |
74 | - | then cell(cells, (row - 2), (col + 2)) | |
75 | - | else "")) + (if (if ((row >= 1)) | |
76 | - | then (13 >= col) | |
77 | - | else false) | |
78 | - | then cell(cells, (row - 1), (col + 1)) | |
79 | - | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
80 | - | then (col >= 1) | |
81 | - | else false) | |
82 | - | then cell(cells, (row + 1), (col - 1)) | |
83 | - | else "")) + (if (if ((12 >= row)) | |
84 | - | then (col >= 2) | |
85 | - | else false) | |
86 | - | then cell(cells, (row + 2), (col - 2)) | |
87 | - | else "")) + (if (if ((11 >= row)) | |
88 | - | then (col >= 3) | |
89 | - | else false) | |
90 | - | then cell(cells, (row + 3), (col - 3)) | |
91 | - | else "")) + (if (if ((10 >= row)) | |
92 | - | then (col >= 4) | |
93 | - | else false) | |
94 | - | then cell(cells, (row + 4), (col - 4)) | |
95 | - | else "")) | |
96 | - | ||
97 | - | ||
98 | - | func getLDiag (cells,row,col) = (((((((((if (if ((row >= 4)) | |
99 | - | then (col >= 4) | |
100 | - | else false) | |
101 | - | then cell(cells, (row - 4), (col - 4)) | |
102 | - | else "") + (if (if ((row >= 3)) | |
103 | - | then (col >= 3) | |
104 | - | else false) | |
105 | - | then cell(cells, (row - 3), (col - 3)) | |
106 | - | else "")) + (if (if ((row >= 2)) | |
107 | - | then (col >= 2) | |
108 | - | else false) | |
109 | - | then cell(cells, (row - 2), (col - 2)) | |
110 | - | else "")) + (if (if ((row >= 1)) | |
111 | - | then (col >= 1) | |
112 | - | else false) | |
113 | - | then cell(cells, (row - 1), (col - 1)) | |
114 | - | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
115 | - | then (13 >= col) | |
116 | - | else false) | |
117 | - | then cell(cells, (row + 1), (col + 1)) | |
118 | - | else "")) + (if (if ((12 >= row)) | |
119 | - | then (12 >= col) | |
120 | - | else false) | |
121 | - | then cell(cells, (row + 2), (col + 2)) | |
122 | - | else "")) + (if (if ((11 >= row)) | |
123 | - | then (11 >= col) | |
124 | - | else false) | |
125 | - | then cell(cells, (row + 3), (col + 3)) | |
126 | - | else "")) + (if (if ((10 >= row)) | |
127 | - | then (10 >= col) | |
128 | - | else false) | |
129 | - | then cell(cells, (row + 4), (col + 4)) | |
130 | - | else "")) | |
131 | - | ||
132 | - | ||
133 | 25 | func checkField (cells,c,row,col) = { | |
134 | - | let targetLines = ((((((getRow(cells, row, col) + "|") + getColumn(cells, row, col)) + "|") + getRDiag(cells, row, col)) + "|") + getLDiag(cells, row, col)) | |
26 | + | let targetLines = ((((((((((((((((((((((((((((((((((((if ((col >= 4)) | |
27 | + | then cell(cells, row, (col - 4)) | |
28 | + | else "") + (if ((col >= 3)) | |
29 | + | then cell(cells, row, (col - 3)) | |
30 | + | else "")) + (if ((col >= 2)) | |
31 | + | then cell(cells, row, (col - 2)) | |
32 | + | else "")) + (if ((col >= 1)) | |
33 | + | then cell(cells, row, (col - 1)) | |
34 | + | else "")) + cell(cells, row, col)) + (if ((13 >= col)) | |
35 | + | then cell(cells, row, (col + 1)) | |
36 | + | else "")) + (if ((12 >= col)) | |
37 | + | then cell(cells, row, (col + 2)) | |
38 | + | else "")) + (if ((11 >= col)) | |
39 | + | then cell(cells, row, (col + 3)) | |
40 | + | else "")) + (if ((10 >= col)) | |
41 | + | then cell(cells, row, (col + 4)) | |
42 | + | else "")) + (if ((row >= 4)) | |
43 | + | then cell(cells, (row - 4), col) | |
44 | + | else "")) + (if ((row >= 3)) | |
45 | + | then cell(cells, (row - 3), col) | |
46 | + | else "")) + (if ((row >= 2)) | |
47 | + | then cell(cells, (row - 2), col) | |
48 | + | else "")) + (if ((row >= 1)) | |
49 | + | then cell(cells, (row - 1), col) | |
50 | + | else "")) + cell(cells, row, col)) + (if ((13 >= row)) | |
51 | + | then cell(cells, (row + 1), col) | |
52 | + | else "")) + (if ((12 >= row)) | |
53 | + | then cell(cells, (row + 2), col) | |
54 | + | else "")) + (if ((11 >= row)) | |
55 | + | then cell(cells, (row + 3), col) | |
56 | + | else "")) + (if ((10 >= row)) | |
57 | + | then cell(cells, (row + 4), col) | |
58 | + | else "")) + (if (if ((row >= 4)) | |
59 | + | then (10 >= col) | |
60 | + | else false) | |
61 | + | then cell(cells, (row - 4), (col + 4)) | |
62 | + | else "")) + (if (if ((row >= 3)) | |
63 | + | then (11 >= col) | |
64 | + | else false) | |
65 | + | then cell(cells, (row - 3), (col + 3)) | |
66 | + | else "")) + (if (if ((row >= 2)) | |
67 | + | then (12 >= col) | |
68 | + | else false) | |
69 | + | then cell(cells, (row - 2), (col + 2)) | |
70 | + | else "")) + (if (if ((row >= 1)) | |
71 | + | then (13 >= col) | |
72 | + | else false) | |
73 | + | then cell(cells, (row - 1), (col + 1)) | |
74 | + | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
75 | + | then (col >= 1) | |
76 | + | else false) | |
77 | + | then cell(cells, (row + 1), (col - 1)) | |
78 | + | else "")) + (if (if ((12 >= row)) | |
79 | + | then (col >= 2) | |
80 | + | else false) | |
81 | + | then cell(cells, (row + 2), (col - 2)) | |
82 | + | else "")) + (if (if ((11 >= row)) | |
83 | + | then (col >= 3) | |
84 | + | else false) | |
85 | + | then cell(cells, (row + 3), (col - 3)) | |
86 | + | else "")) + (if (if ((10 >= row)) | |
87 | + | then (col >= 4) | |
88 | + | else false) | |
89 | + | then cell(cells, (row + 4), (col - 4)) | |
90 | + | else "")) + (if (if ((row >= 4)) | |
91 | + | then (col >= 4) | |
92 | + | else false) | |
93 | + | then cell(cells, (row - 4), (col - 4)) | |
94 | + | else "")) + (if (if ((row >= 3)) | |
95 | + | then (col >= 3) | |
96 | + | else false) | |
97 | + | then cell(cells, (row - 3), (col - 3)) | |
98 | + | else "")) + (if (if ((row >= 2)) | |
99 | + | then (col >= 2) | |
100 | + | else false) | |
101 | + | then cell(cells, (row - 2), (col - 2)) | |
102 | + | else "")) + (if (if ((row >= 1)) | |
103 | + | then (col >= 1) | |
104 | + | else false) | |
105 | + | then cell(cells, (row - 1), (col - 1)) | |
106 | + | else "")) + cell(cells, row, col)) + (if (if ((13 >= row)) | |
107 | + | then (13 >= col) | |
108 | + | else false) | |
109 | + | then cell(cells, (row + 1), (col + 1)) | |
110 | + | else "")) + (if (if ((12 >= row)) | |
111 | + | then (12 >= col) | |
112 | + | else false) | |
113 | + | then cell(cells, (row + 2), (col + 2)) | |
114 | + | else "")) + (if (if ((11 >= row)) | |
115 | + | then (11 >= col) | |
116 | + | else false) | |
117 | + | then cell(cells, (row + 3), (col + 3)) | |
118 | + | else "")) + (if (if ((10 >= row)) | |
119 | + | then (10 >= col) | |
120 | + | else false) | |
121 | + | then cell(cells, (row + 4), (col + 4)) | |
122 | + | else "")) | |
135 | 123 | check(targetLines, c) | |
136 | 124 | } | |
137 | 125 | ||
138 | 126 | ||
139 | 127 | func checkFieldB (cells,row,col) = checkField(cells, "b", row, col) | |
140 | 128 | ||
141 | 129 | ||
142 | 130 | func checkFieldW (cells,row,col) = checkField(cells, "w", row, col) | |
143 | 131 | ||
144 | 132 | ||
145 | 133 | @Callable(i) | |
146 | 134 | func test (game,row,col,color) = { | |
147 | 135 | let cells = extract(getString(this, (("game:" + toString(game)) + "_cells"))) | |
148 | 136 | throw(toString(checkField(cells, color, row, col))) | |
149 | 137 | } | |
150 | 138 | ||
151 | 139 | ||
152 | 140 | ||
153 | 141 | @Callable(i) | |
154 | 142 | func testSetCell (game,row,col,val) = { | |
155 | 143 | let cells = extract(getString(this, (("game:" + toString(game)) + "_cells"))) | |
156 | 144 | let newCells = setCell(cells, row, col, val) | |
157 | 145 | WriteSet([DataEntry((("game:" + toString(game)) + "_cells"), newCells)]) | |
158 | 146 | } | |
159 | 147 | ||
160 | 148 | ||
161 | 149 | @Verifier(tx) | |
162 | 150 | func verify () = true | |
163 | 151 |
github/deemru/w8io/026f985 38.37 ms ◑