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