tx · 9HXUW3e7qW9yfEXJrruUCqGnpndLRLxgqDEmocWPGwTf

3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5:  -0.05000000 Waves

2024.08.20 14:50 [3247120] smart account 3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5 > SELF 0.00000000 Waves

{ "type": 13, "id": "9HXUW3e7qW9yfEXJrruUCqGnpndLRLxgqDEmocWPGwTf", "fee": 5000000, "feeAssetId": null, "timestamp": 1724154641290, "version": 2, "chainId": 84, "sender": "3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5", "senderPublicKey": "DhKSnv34wE65np8uDd8E6ygEbNsn6fHx9p7q4hJTcgRw", "proofs": [ "5YuPUDSJnCbe5QCS5fSyp4aSXGdcxeAQ92a5cmakJY6DKFw2Mi7tdY7P4QHGg2uknpp1MYpVbPD7F33MCoJ4B34q" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgQKAggIAAAACQAAAAAMQkFJX0NPTlRSQUNUAgAAACMzTjl0S2l4enFUWVduRVhReHJEUTVwQlRHdlFkNnNGc3ZtVgAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAAGUExBWUVSAgAAAAExAAAAAAJBSQIAAAABMgAAAAAOV0lOTklOR19BTU9VTlQEAAAAByRtYXRjaDAJAAQfAAAAAQIAAAAOd2lubmluZ19hbW91bnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABaQUAAAAHJG1hdGNoMAUAAAABaQAAAAAABfXhAAEAAAAGY2hhckF0AAAAAgAAAANzdHIAAAABaQkAAZEAAAACCQAEtQAAAAIFAAAAA3N0cgIAAAAABQAAAAFpAQAAABJjaGVja0lmTW92ZUlzVmFsaWQAAAACAAAABmdhbWVJZAAAAAVib2FyZAQAAAAMY3VycmVudEJvYXJkBAAAAAckbWF0Y2gwCQAEIgAAAAEJAAEsAAAAAgIAAAANY3Vycm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1cnJlbnRCb2FyZF8FAAAABmdhbWVJZAUAAAAFYm9hcmQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAAppbml0aWF0b3JfBQAAAAZnYW1lSWQJAAQlAAAAAQUAAAAGc2VuZGVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAHd2lubmVyXwUAAAAGZ2FtZUlkAgAAAARub25lCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAMbmV4dF9wbGF5ZXJfBQAAAAZnYW1lSWQFAAAAAkFJBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlpTJM3", "height": 3247120, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9NqTRapnZEnpEcgMWsH2NtMJrq2Dm6dJ1vVMzULqTJvP Next: 83MTpnBtpe2b2riaztqLGWQUA7HTtdsefpSdDEUvsYtc Diff:
OldNewDifferences
99
1010 let AI = "2"
1111
12-let WINNING_AMOUNT = 100000000
12+let WINNING_AMOUNT = match getInteger("winning_amount") {
13+ case i: Int =>
14+ i
15+ case _ =>
16+ 100000000
17+}
1318
1419 func charAt (str,i) = split(str, "")[i]
1520
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BAI_CONTRACT = "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV"
55
66 let BAI_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
77
88 let PLAYER = "1"
99
1010 let AI = "2"
1111
12-let WINNING_AMOUNT = 100000000
12+let WINNING_AMOUNT = match getInteger("winning_amount") {
13+ case i: Int =>
14+ i
15+ case _ =>
16+ 100000000
17+}
1318
1419 func charAt (str,i) = split(str, "")[i]
1520
1621
1722 func checkIfMoveIsValid (gameId,board) = {
1823 let currentBoard = match getString(("currentBoard_" + gameId)) {
1924 case s: String =>
2025 s
2126 case _ =>
2227 "000000000"
2328 }
2429 let firstSelected = if ((charAt(board, 0) != charAt(currentBoard, 0)))
2530 then 1
2631 else 0
2732 let secondSelected = if ((charAt(board, 1) != charAt(currentBoard, 1)))
2833 then 1
2934 else 0
3035 let thirdSelected = if ((charAt(board, 2) != charAt(currentBoard, 2)))
3136 then 1
3237 else 0
3338 let fourthSelected = if ((charAt(board, 3) != charAt(currentBoard, 3)))
3439 then 1
3540 else 0
3641 let fifthSelected = if ((charAt(board, 4) != charAt(currentBoard, 4)))
3742 then 1
3843 else 0
3944 let sixthSelected = if ((charAt(board, 5) != charAt(currentBoard, 5)))
4045 then 1
4146 else 0
4247 let seventhSelected = if ((charAt(board, 6) != charAt(currentBoard, 6)))
4348 then 1
4449 else 0
4550 let eighthSelected = if ((charAt(board, 7) != charAt(currentBoard, 7)))
4651 then 1
4752 else 0
4853 let ninthSelected = if ((charAt(board, 8) != charAt(currentBoard, 8)))
4954 then 1
5055 else 0
5156 let firstPositionCorrect = if (if ((charAt(board, 0) == charAt(currentBoard, 0)))
5257 then true
5358 else (charAt(currentBoard, 0) == "0"))
5459 then true
5560 else false
5661 let secondPositionCorrect = if (if ((charAt(board, 1) == charAt(currentBoard, 1)))
5762 then true
5863 else (charAt(currentBoard, 1) == "0"))
5964 then true
6065 else false
6166 let thirdPositionCorrect = if (if ((charAt(board, 2) == charAt(currentBoard, 2)))
6267 then true
6368 else (charAt(currentBoard, 2) == "0"))
6469 then true
6570 else false
6671 let fourthPositionCorrect = if (if ((charAt(board, 3) == charAt(currentBoard, 3)))
6772 then true
6873 else (charAt(currentBoard, 3) == "0"))
6974 then true
7075 else false
7176 let fifthPositionCorrect = if (if ((charAt(board, 4) == charAt(currentBoard, 4)))
7277 then true
7378 else (charAt(currentBoard, 4) == "0"))
7479 then true
7580 else false
7681 let sixthPositionCorrect = if (if ((charAt(board, 5) == charAt(currentBoard, 5)))
7782 then true
7883 else (charAt(currentBoard, 5) == "0"))
7984 then true
8085 else false
8186 let seventhPositionCorrect = if (if ((charAt(board, 6) == charAt(currentBoard, 6)))
8287 then true
8388 else (charAt(currentBoard, 6) == "0"))
8489 then true
8590 else false
8691 let eighthPositionCorrect = if (if ((charAt(board, 7) == charAt(currentBoard, 7)))
8792 then true
8893 else (charAt(currentBoard, 7) == "0"))
8994 then true
9095 else false
9196 let ninthPositionCorrect = if (if ((charAt(board, 8) == charAt(currentBoard, 8)))
9297 then true
9398 else (charAt(currentBoard, 8) == "0"))
9499 then true
95100 else false
96101 let noOldPositionOverwritten = if (if (if (if (if (if (if (if (firstPositionCorrect)
97102 then secondPositionCorrect
98103 else false)
99104 then thirdPositionCorrect
100105 else false)
101106 then fourthPositionCorrect
102107 else false)
103108 then fifthPositionCorrect
104109 else false)
105110 then sixthPositionCorrect
106111 else false)
107112 then seventhPositionCorrect
108113 else false)
109114 then eighthPositionCorrect
110115 else false)
111116 then ninthPositionCorrect
112117 else false
113118 let countMoves = ((((((((firstSelected + secondSelected) + thirdSelected) + fourthSelected) + fifthSelected) + sixthSelected) + seventhSelected) + eighthSelected) + ninthSelected)
114119 let onlyOneMove = (1 >= countMoves)
115120 if ((countMoves > 1))
116121 then throw("More than move made!")
117122 else if (!(noOldPositionOverwritten))
118123 then throw("Former position overwritten!")
119124 else if (noOldPositionOverwritten)
120125 then onlyOneMove
121126 else false
122127 }
123128
124129
125130 func checkIfPlayerHasWon (gameId,board,player) = {
126131 let winningCombinations = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
127132 let topRow = if (if ((charAt(board, winningCombinations[0][0]) == player))
128133 then (charAt(board, winningCombinations[0][1]) == player)
129134 else false)
130135 then (charAt(board, winningCombinations[0][2]) == player)
131136 else false
132137 let middleRow = if (if ((charAt(board, winningCombinations[1][0]) == player))
133138 then (charAt(board, winningCombinations[1][1]) == player)
134139 else false)
135140 then (charAt(board, winningCombinations[1][2]) == player)
136141 else false
137142 let bottomRow = if (if ((charAt(board, winningCombinations[2][0]) == player))
138143 then (charAt(board, winningCombinations[2][1]) == player)
139144 else false)
140145 then (charAt(board, winningCombinations[2][2]) == player)
141146 else false
142147 let leftColumn = if (if ((charAt(board, winningCombinations[3][0]) == player))
143148 then (charAt(board, winningCombinations[3][1]) == player)
144149 else false)
145150 then (charAt(board, winningCombinations[3][2]) == player)
146151 else false
147152 let middleColumn = if (if ((charAt(board, winningCombinations[4][0]) == player))
148153 then (charAt(board, winningCombinations[4][1]) == player)
149154 else false)
150155 then (charAt(board, winningCombinations[4][2]) == player)
151156 else false
152157 let rightColumn = if (if ((charAt(board, winningCombinations[5][0]) == player))
153158 then (charAt(board, winningCombinations[5][1]) == player)
154159 else false)
155160 then (charAt(board, winningCombinations[5][2]) == player)
156161 else false
157162 let diagonalOne = if (if ((charAt(board, winningCombinations[6][0]) == player))
158163 then (charAt(board, winningCombinations[6][1]) == player)
159164 else false)
160165 then (charAt(board, winningCombinations[6][2]) == player)
161166 else false
162167 let diagonalTwo = if (if ((charAt(board, winningCombinations[7][0]) == player))
163168 then (charAt(board, winningCombinations[7][1]) == player)
164169 else false)
165170 then (charAt(board, winningCombinations[7][2]) == player)
166171 else false
167172 if (if (if (if (if (if (if (topRow)
168173 then true
169174 else middleRow)
170175 then true
171176 else bottomRow)
172177 then true
173178 else leftColumn)
174179 then true
175180 else middleColumn)
176181 then true
177182 else rightColumn)
178183 then true
179184 else diagonalOne)
180185 then true
181186 else diagonalTwo
182187 }
183188
184189
185190 func getPossibleMovesCount (board) = {
186191 let firstMovePossible = if ((charAt(board, 0) == "0"))
187192 then 1
188193 else 0
189194 let secondMovePossible = if ((charAt(board, 1) == "0"))
190195 then 1
191196 else 0
192197 let thirdMovePossible = if ((charAt(board, 2) == "0"))
193198 then 1
194199 else 0
195200 let fourthMovePossible = if ((charAt(board, 3) == "0"))
196201 then 1
197202 else 0
198203 let fifthMovePossible = if ((charAt(board, 4) == "0"))
199204 then 1
200205 else 0
201206 let sixthMovePossible = if ((charAt(board, 5) == "0"))
202207 then 1
203208 else 0
204209 let seventhMovePossible = if ((charAt(board, 6) == "0"))
205210 then 1
206211 else 0
207212 let eigthMovePossible = if ((charAt(board, 7) == "0"))
208213 then 1
209214 else 0
210215 let ninthMovePossible = if ((charAt(board, 8) == "0"))
211216 then 1
212217 else 0
213218 ((((((((firstMovePossible + secondMovePossible) + thirdMovePossible) + fourthMovePossible) + fifthMovePossible) + sixthMovePossible) + seventhMovePossible) + eigthMovePossible) + ninthMovePossible)
214219 }
215220
216221
217222 @Callable(i)
218223 func callback (gameIdAndBoard) = {
219224 let parts = split(gameIdAndBoard, "_")
220225 let gameId = parts[0]
221226 let board = parts[1]
222227 let nextPlayer = match getString(("next_player_" + gameId)) {
223228 case s: String =>
224229 s
225230 case _ =>
226231 ""
227232 }
228233 let moveOfAIIsValid = checkIfMoveIsValid(gameId, board)
229234 if (!(moveOfAIIsValid))
230235 then throw("Illegal move!")
231236 else if ((nextPlayer != AI))
232237 then throw("Player has to move first!")
233238 else {
234239 let aiHasWon = checkIfPlayerHasWon(gameId, board, AI)
235240 if (aiHasWon)
236241 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "ai")]
237242 else [StringEntry(("currentBoard_" + gameId), board), StringEntry(("next_player_" + gameId), PLAYER)]
238243 }
239244 }
240245
241246
242247
243248 @Callable(i)
244249 func playTTT (game,board) = {
245250 let numberOfPayments = size(i.payments)
246251 if ((numberOfPayments != 1))
247252 then throw("Payment necessary!")
248253 else {
249254 let payment = i.payments[0]
250255 let fee = payment.amount
251256 let feeAssetId = payment.assetId
252257 let minFee = match getInteger(Address(fromBase58String(BAI_CONTRACT)), "price_tictactoe") {
253258 case n: Int =>
254259 n
255260 case _ =>
256261 0
257262 }
258263 if (if ((feeAssetId != BAI_ASSET_ID))
259264 then true
260265 else (minFee > fee))
261266 then throw("Payment of the minimal BAI amount necessary!")
262267 else {
263268 let sender = i.caller
264269 let gameId = if ((size(game) == 0))
265270 then toBase58String(i.transactionId)
266271 else game
267272 let nextPlayer = match getString(("next_player_" + gameId)) {
268273 case s: String =>
269274 s
270275 case _ =>
271276 PLAYER
272277 }
273278 if ((nextPlayer != PLAYER))
274279 then throw("AI hast to move first!")
275280 else {
276281 let currentBoard = match getString(("currentBoard_" + gameId)) {
277282 case s: String =>
278283 s
279284 case _ =>
280285 board
281286 }
282287 let initiator = match getString(("initiator_" + gameId)) {
283288 case s: String =>
284289 s
285290 case _ =>
286291 toString(sender)
287292 }
288293 if ((toString(sender) != initiator))
289294 then throw("Only initiator is allowed to make moves!")
290295 else {
291296 let moveOfPlayerIsValid = checkIfMoveIsValid(gameId, board)
292297 if (!(moveOfPlayerIsValid))
293298 then throw("Illegal move!")
294299 else {
295300 let playerHasWon = checkIfPlayerHasWon(gameId, board, PLAYER)
296301 let numberOfPossibleMoves = getPossibleMovesCount(board)
297302 if (playerHasWon)
298303 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "player"), ScriptTransfer(sender, WINNING_AMOUNT, BAI_ASSET_ID)]
299304 else if ((numberOfPossibleMoves == 0))
300305 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "draw")]
301306 else {
302307 let nextMove = invoke(Address(fromBase58String(BAI_CONTRACT)), "registerTaskCallback", [((gameId + "_") + board), "tictactoe", "callback"], [AttachedPayment(BAI_ASSET_ID, 10000000)])
303308 if ((nextMove == nextMove))
304309 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("initiator_" + gameId), toString(sender)), StringEntry(("winner_" + gameId), "none"), StringEntry(("next_player_" + gameId), AI)]
305310 else throw("Strict value is not equal to itself.")
306311 }
307312 }
308313 }
309314 }
310315 }
311316 }
312317 }
313318
314319
315320 @Verifier(tx)
316321 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
317322

github/deemru/w8io/026f985 
34.24 ms