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