tx · EDqrMca5rAySMJjE8azrGFXS73Gx7VyjR6L7ExoccpBq 3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs: -0.01000000 Waves 2019.07.31 14:50 [610229] smart account 3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs > SELF 0.00000000 Waves
{ "type": 13, "id": "EDqrMca5rAySMJjE8azrGFXS73Gx7VyjR6L7ExoccpBq", "fee": 1000000, "feeAssetId": null, "timestamp": 1564573842635, "version": 1, "sender": "3Mth4mJpNbm6N6PQsgnP5KzcHBfC2Luiyfs", "senderPublicKey": "GL5QvqgydTUCg1sj1s7juR6hVfxLHjZ37Kr5sAX4D4an", "proofs": [ "yWqqPW9rpV2yz6GDkpFSDcuXtuAapvBUX5LXtgiWcfKxVToZEkTsYX9fwKSaNBtuVwuFHND5NodNTqAGWkHFyQY" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAQAAAAlmaXZlQ2hhcnMAAAABAAAAAWMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAABYwUAAAABYwUAAAABYwUAAAABYwUAAAABYwEAAAAEY2VsbAAAAAMAAAAFY2VsbHMAAAADcm93AAAAA2NvbAkBAAAACXRha2VSaWdodAAAAAIJAAEvAAAAAgUAAAAFY2VsbHMJAABkAAAAAgkAAGQAAAACCQAAaAAAAAIFAAAAA3JvdwAAAAAAAAAADwUAAAADY29sAAAAAAAAAAABAAAAAAAAAAABAQAAAAdzZXRDZWxsAAAABAAAAAVjZWxscwAAAANyb3cAAAADY29sAAAAA3ZhbAkAASwAAAACCQABLAAAAAIJAAEvAAAAAgUAAAAFY2VsbHMJAABkAAAAAgkAAGgAAAACBQAAAANyb3cAAAAAAAAAAA8FAAAAA2NvbAUAAAADdmFsCQABLwAAAAIFAAAABWNlbGxzCQAAZQAAAAIJAAExAAAAAQUAAAAFY2VsbHMJAABkAAAAAgkAAGQAAAACCQAAaAAAAAIFAAAAA3JvdwAAAAAAAAAADwUAAAADY29sA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AFpAQAAAAt0ZXN0U2V0Q2VsbAAAAAQAAAAEZ2FtZQAAAANyb3cAAAADY29sAAAAA3ZhbAQAAAAFY2VsbHMJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAAFZ2FtZToJAAGkAAAAAQUAAAAEZ2FtZQIAAAAGX2NlbGxzBAAAAAhuZXdDZWxscwkBAAAAB3NldENlbGwAAAAEBQAAAAVjZWxscwUAAAADcm93BQAAAANjb2wFAAAAA3ZhbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABWdhbWU6CQABpAAAAAEFAAAABGdhbWUCAAAABl9jZWxscwUAAAAIbmV3Q2VsbHMFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAGXXHoGg==", "chainId": 84, "height": 610229, "spentComplexity": 0 } View: original | compacted Prev: none Next: 5kKpi5KFb2ywKL2ajeWhRUbrGABP875UznwWfPJGif5b Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func fiveChars (c) = ((((c + c) + c) + c) + c) | |
5 | + | ||
6 | + | ||
7 | + | func cell (cells,row,col) = takeRight(take(cells, (((row * 15) + col) + 1)), 1) | |
8 | + | ||
9 | + | ||
10 | + | func setCell (cells,row,col,val) = ((take(cells, ((row * 15) + col)) + val) + take(cells, (size(cells) - (((row * 15) + col) + 1)))) | |
11 | + | ||
12 | + | ||
13 | + | func row (cells,row) = ((((((((((((((cell(cells, row, 0) + cell(cells, row, 1)) + cell(cells, row, 2)) + cell(cells, row, 3)) + cell(cells, row, 4)) + cell(cells, row, 5)) + cell(cells, row, 6)) + cell(cells, row, 7)) + cell(cells, row, 8)) + cell(cells, row, 9)) + cell(cells, row, 10)) + cell(cells, row, 11)) + cell(cells, row, 12)) + cell(cells, row, 13)) + cell(cells, row, 14)) | |
14 | + | ||
15 | + | ||
16 | + | func column (cells,col) = ((((((((((((((cell(cells, 0, col) + cell(cells, 1, col)) + cell(cells, 2, col)) + cell(cells, 3, col)) + cell(cells, 4, col)) + cell(cells, 5, col)) + cell(cells, 6, col)) + cell(cells, 7, col)) + cell(cells, 8, col)) + cell(cells, 9, col)) + cell(cells, 10, col)) + cell(cells, 11, col)) + cell(cells, 12, col)) + cell(cells, 13, col)) + cell(cells, 14, col)) | |
17 | + | ||
18 | + | ||
19 | + | func diagHelper (cells,d,dir,i) = if ((dir == "R")) | |
20 | + | then if (if ((d >= i)) | |
21 | + | then ((14 + i) >= d) | |
22 | + | else false) | |
23 | + | then cell(cells, i, (d - i)) | |
24 | + | else "" | |
25 | + | else if ((dir == "L")) | |
26 | + | then if (if ((d >= i)) | |
27 | + | then ((14 + i) >= d) | |
28 | + | else false) | |
29 | + | then cell(cells, (d - i), (14 - i)) | |
30 | + | else "" | |
31 | + | else throw("invalid dir in diagHelper function") | |
32 | + | ||
33 | + | ||
34 | + | func diag (cells,d,dir) = ((((((((((((((diagHelper(cells, d, dir, 14) + diagHelper(cells, d, dir, 13)) + diagHelper(cells, d, dir, 12)) + diagHelper(cells, d, dir, 11)) + diagHelper(cells, d, dir, 10)) + diagHelper(cells, d, dir, 9)) + diagHelper(cells, d, dir, 8)) + diagHelper(cells, d, dir, 7)) + diagHelper(cells, d, dir, 6)) + diagHelper(cells, d, dir, 5)) + diagHelper(cells, d, dir, 4)) + diagHelper(cells, d, dir, 3)) + diagHelper(cells, d, dir, 2)) + diagHelper(cells, d, dir, 1)) + diagHelper(cells, d, dir, 0)) | |
35 | + | ||
36 | + | ||
37 | + | func check (line,c) = if (if ((c != "b")) | |
38 | + | then (c != "w") | |
39 | + | else false) | |
40 | + | then throw("invalid color in check function") | |
41 | + | else match indexOf(line, fiveChars(c)) { | |
42 | + | case _: Int => | |
43 | + | true | |
44 | + | case _ => | |
45 | + | false | |
46 | + | } | |
47 | + | ||
48 | + | ||
49 | + | @Callable(i) | |
50 | + | func test (game,d,dir) = { | |
51 | + | let cells = extract(getString(this, (("game:" + toString(game)) + "_cells"))) | |
52 | + | throw(diag(cells, d, dir)) | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(i) | |
58 | + | func testSetCell (game,row,col,val) = { | |
59 | + | let cells = extract(getString(this, (("game:" + toString(game)) + "_cells"))) | |
60 | + | let newCells = setCell(cells, row, col, val) | |
61 | + | WriteSet([DataEntry((("game:" + toString(game)) + "_cells"), newCells)]) | |
62 | + | } | |
63 | + | ||
64 | + | ||
65 | + | @Verifier(tx) | |
66 | + | func verify () = true | |
67 | + |
github/deemru/w8io/169f3d6 41.68 ms ◑