tx · 83MTpnBtpe2b2riaztqLGWQUA7HTtdsefpSdDEUvsYtc

3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5:  -0.05000000 Waves

2024.09.09 17:45 [3276214] smart account 3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5 > SELF 0.00000000 Waves

{ "type": 13, "id": "83MTpnBtpe2b2riaztqLGWQUA7HTtdsefpSdDEUvsYtc", "fee": 5000000, "feeAssetId": null, "timestamp": 1725893126889, "version": 2, "chainId": 84, "sender": "3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5", "senderPublicKey": "DhKSnv34wE65np8uDd8E6ygEbNsn6fHx9p7q4hJTcgRw", "proofs": [ "2rPVxRp49VVSqwqQ4L4VbVq6gkMu6qCbWU8YGxB4P4KuPk1NCpmN2CP8ofxntdrFDDnU2qYGUExuK9edGEr4Q4kx" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgQKAggIAAAACQAAAAAMQkFJX0NPTlRSQUNUAgAAACMzTjl0S2l4enFUWVduRVhReHJEUTVwQlRHdlFkNnNGc3ZtVgAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAAGUExBWUVSAgAAAAExAAAAAAJBSQIAAAABMgAAAAAOV0lOTklOR19BTU9VTlQEAAAAByRtYXRjaDAJAAQfAAAAAQIAAAAOd2lubmluZ19hbW91bnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABaQUAAAAHJG1hdGNoMAUAAAABaQAAAAAAHc1lAAEAAAAGY2hhckF0AAAAAgAAAANzdHIAAAABaQkAAZEAAAACCQAEtQAAAAIFAAAAA3N0cgIAAAAABQAAAAFpAQAAABJjaGVja0lmTW92ZUlzVmFsaWQAAAACAAAABmdhbWVJZAAAAAVib2FyZAQAAAAMY3VycmVudEJvYXJkBAAAAAckbWF0Y2gwCQAEIgAAAAEJAAEsAAAAAgIAAAANY3VycmV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cnJlbnRCb2FyZF8FAAAABmdhbWVJZAUAAAAFYm9hcmQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAAppbml0aWF0b3JfBQAAAAZnYW1lSWQJAAQlAAAAAQUAAAAGc2VuZGVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAHd2lubmVyXwUAAAAGZ2FtZUlkAgAAAARub25lCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAMbmV4dF9wbGF5ZXJfBQAAAAZnYW1lSWQFAAAAAkFJBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmWEZd8", "height": 3276214, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9HXUW3e7qW9yfEXJrruUCqGnpndLRLxgqDEmocWPGwTf Next: GyKh7FGVCAL4xcc72iDjBMLCv6WMi88iLnkMvbLfHEkS Diff:
OldNewDifferences
1313 case i: Int =>
1414 i
1515 case _ =>
16- 100000000
16+ 500000000
1717 }
1818
1919 func charAt (str,i) = split(str, "")[i]
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
1212 let WINNING_AMOUNT = match getInteger("winning_amount") {
1313 case i: Int =>
1414 i
1515 case _ =>
16- 100000000
16+ 500000000
1717 }
1818
1919 func charAt (str,i) = split(str, "")[i]
2020
2121
2222 func checkIfMoveIsValid (gameId,board) = {
2323 let currentBoard = match getString(("currentBoard_" + gameId)) {
2424 case s: String =>
2525 s
2626 case _ =>
2727 "000000000"
2828 }
2929 let firstSelected = if ((charAt(board, 0) != charAt(currentBoard, 0)))
3030 then 1
3131 else 0
3232 let secondSelected = if ((charAt(board, 1) != charAt(currentBoard, 1)))
3333 then 1
3434 else 0
3535 let thirdSelected = if ((charAt(board, 2) != charAt(currentBoard, 2)))
3636 then 1
3737 else 0
3838 let fourthSelected = if ((charAt(board, 3) != charAt(currentBoard, 3)))
3939 then 1
4040 else 0
4141 let fifthSelected = if ((charAt(board, 4) != charAt(currentBoard, 4)))
4242 then 1
4343 else 0
4444 let sixthSelected = if ((charAt(board, 5) != charAt(currentBoard, 5)))
4545 then 1
4646 else 0
4747 let seventhSelected = if ((charAt(board, 6) != charAt(currentBoard, 6)))
4848 then 1
4949 else 0
5050 let eighthSelected = if ((charAt(board, 7) != charAt(currentBoard, 7)))
5151 then 1
5252 else 0
5353 let ninthSelected = if ((charAt(board, 8) != charAt(currentBoard, 8)))
5454 then 1
5555 else 0
5656 let firstPositionCorrect = if (if ((charAt(board, 0) == charAt(currentBoard, 0)))
5757 then true
5858 else (charAt(currentBoard, 0) == "0"))
5959 then true
6060 else false
6161 let secondPositionCorrect = if (if ((charAt(board, 1) == charAt(currentBoard, 1)))
6262 then true
6363 else (charAt(currentBoard, 1) == "0"))
6464 then true
6565 else false
6666 let thirdPositionCorrect = if (if ((charAt(board, 2) == charAt(currentBoard, 2)))
6767 then true
6868 else (charAt(currentBoard, 2) == "0"))
6969 then true
7070 else false
7171 let fourthPositionCorrect = if (if ((charAt(board, 3) == charAt(currentBoard, 3)))
7272 then true
7373 else (charAt(currentBoard, 3) == "0"))
7474 then true
7575 else false
7676 let fifthPositionCorrect = if (if ((charAt(board, 4) == charAt(currentBoard, 4)))
7777 then true
7878 else (charAt(currentBoard, 4) == "0"))
7979 then true
8080 else false
8181 let sixthPositionCorrect = if (if ((charAt(board, 5) == charAt(currentBoard, 5)))
8282 then true
8383 else (charAt(currentBoard, 5) == "0"))
8484 then true
8585 else false
8686 let seventhPositionCorrect = if (if ((charAt(board, 6) == charAt(currentBoard, 6)))
8787 then true
8888 else (charAt(currentBoard, 6) == "0"))
8989 then true
9090 else false
9191 let eighthPositionCorrect = if (if ((charAt(board, 7) == charAt(currentBoard, 7)))
9292 then true
9393 else (charAt(currentBoard, 7) == "0"))
9494 then true
9595 else false
9696 let ninthPositionCorrect = if (if ((charAt(board, 8) == charAt(currentBoard, 8)))
9797 then true
9898 else (charAt(currentBoard, 8) == "0"))
9999 then true
100100 else false
101101 let noOldPositionOverwritten = if (if (if (if (if (if (if (if (firstPositionCorrect)
102102 then secondPositionCorrect
103103 else false)
104104 then thirdPositionCorrect
105105 else false)
106106 then fourthPositionCorrect
107107 else false)
108108 then fifthPositionCorrect
109109 else false)
110110 then sixthPositionCorrect
111111 else false)
112112 then seventhPositionCorrect
113113 else false)
114114 then eighthPositionCorrect
115115 else false)
116116 then ninthPositionCorrect
117117 else false
118118 let countMoves = ((((((((firstSelected + secondSelected) + thirdSelected) + fourthSelected) + fifthSelected) + sixthSelected) + seventhSelected) + eighthSelected) + ninthSelected)
119119 let onlyOneMove = (1 >= countMoves)
120120 if ((countMoves > 1))
121121 then throw("More than move made!")
122122 else if (!(noOldPositionOverwritten))
123123 then throw("Former position overwritten!")
124124 else if (noOldPositionOverwritten)
125125 then onlyOneMove
126126 else false
127127 }
128128
129129
130130 func checkIfPlayerHasWon (gameId,board,player) = {
131131 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]]
132132 let topRow = if (if ((charAt(board, winningCombinations[0][0]) == player))
133133 then (charAt(board, winningCombinations[0][1]) == player)
134134 else false)
135135 then (charAt(board, winningCombinations[0][2]) == player)
136136 else false
137137 let middleRow = if (if ((charAt(board, winningCombinations[1][0]) == player))
138138 then (charAt(board, winningCombinations[1][1]) == player)
139139 else false)
140140 then (charAt(board, winningCombinations[1][2]) == player)
141141 else false
142142 let bottomRow = if (if ((charAt(board, winningCombinations[2][0]) == player))
143143 then (charAt(board, winningCombinations[2][1]) == player)
144144 else false)
145145 then (charAt(board, winningCombinations[2][2]) == player)
146146 else false
147147 let leftColumn = if (if ((charAt(board, winningCombinations[3][0]) == player))
148148 then (charAt(board, winningCombinations[3][1]) == player)
149149 else false)
150150 then (charAt(board, winningCombinations[3][2]) == player)
151151 else false
152152 let middleColumn = if (if ((charAt(board, winningCombinations[4][0]) == player))
153153 then (charAt(board, winningCombinations[4][1]) == player)
154154 else false)
155155 then (charAt(board, winningCombinations[4][2]) == player)
156156 else false
157157 let rightColumn = if (if ((charAt(board, winningCombinations[5][0]) == player))
158158 then (charAt(board, winningCombinations[5][1]) == player)
159159 else false)
160160 then (charAt(board, winningCombinations[5][2]) == player)
161161 else false
162162 let diagonalOne = if (if ((charAt(board, winningCombinations[6][0]) == player))
163163 then (charAt(board, winningCombinations[6][1]) == player)
164164 else false)
165165 then (charAt(board, winningCombinations[6][2]) == player)
166166 else false
167167 let diagonalTwo = if (if ((charAt(board, winningCombinations[7][0]) == player))
168168 then (charAt(board, winningCombinations[7][1]) == player)
169169 else false)
170170 then (charAt(board, winningCombinations[7][2]) == player)
171171 else false
172172 if (if (if (if (if (if (if (topRow)
173173 then true
174174 else middleRow)
175175 then true
176176 else bottomRow)
177177 then true
178178 else leftColumn)
179179 then true
180180 else middleColumn)
181181 then true
182182 else rightColumn)
183183 then true
184184 else diagonalOne)
185185 then true
186186 else diagonalTwo
187187 }
188188
189189
190190 func getPossibleMovesCount (board) = {
191191 let firstMovePossible = if ((charAt(board, 0) == "0"))
192192 then 1
193193 else 0
194194 let secondMovePossible = if ((charAt(board, 1) == "0"))
195195 then 1
196196 else 0
197197 let thirdMovePossible = if ((charAt(board, 2) == "0"))
198198 then 1
199199 else 0
200200 let fourthMovePossible = if ((charAt(board, 3) == "0"))
201201 then 1
202202 else 0
203203 let fifthMovePossible = if ((charAt(board, 4) == "0"))
204204 then 1
205205 else 0
206206 let sixthMovePossible = if ((charAt(board, 5) == "0"))
207207 then 1
208208 else 0
209209 let seventhMovePossible = if ((charAt(board, 6) == "0"))
210210 then 1
211211 else 0
212212 let eigthMovePossible = if ((charAt(board, 7) == "0"))
213213 then 1
214214 else 0
215215 let ninthMovePossible = if ((charAt(board, 8) == "0"))
216216 then 1
217217 else 0
218218 ((((((((firstMovePossible + secondMovePossible) + thirdMovePossible) + fourthMovePossible) + fifthMovePossible) + sixthMovePossible) + seventhMovePossible) + eigthMovePossible) + ninthMovePossible)
219219 }
220220
221221
222222 @Callable(i)
223223 func callback (gameIdAndBoard) = {
224224 let parts = split(gameIdAndBoard, "_")
225225 let gameId = parts[0]
226226 let board = parts[1]
227227 let nextPlayer = match getString(("next_player_" + gameId)) {
228228 case s: String =>
229229 s
230230 case _ =>
231231 ""
232232 }
233233 let moveOfAIIsValid = checkIfMoveIsValid(gameId, board)
234234 if (!(moveOfAIIsValid))
235235 then throw("Illegal move!")
236236 else if ((nextPlayer != AI))
237237 then throw("Player has to move first!")
238238 else {
239239 let aiHasWon = checkIfPlayerHasWon(gameId, board, AI)
240240 if (aiHasWon)
241241 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "ai")]
242242 else [StringEntry(("currentBoard_" + gameId), board), StringEntry(("next_player_" + gameId), PLAYER)]
243243 }
244244 }
245245
246246
247247
248248 @Callable(i)
249249 func playTTT (game,board) = {
250250 let numberOfPayments = size(i.payments)
251251 if ((numberOfPayments != 1))
252252 then throw("Payment necessary!")
253253 else {
254254 let payment = i.payments[0]
255255 let fee = payment.amount
256256 let feeAssetId = payment.assetId
257257 let minFee = match getInteger(Address(fromBase58String(BAI_CONTRACT)), "price_tictactoe") {
258258 case n: Int =>
259259 n
260260 case _ =>
261261 0
262262 }
263263 if (if ((feeAssetId != BAI_ASSET_ID))
264264 then true
265265 else (minFee > fee))
266266 then throw("Payment of the minimal BAI amount necessary!")
267267 else {
268268 let sender = i.caller
269269 let gameId = if ((size(game) == 0))
270270 then toBase58String(i.transactionId)
271271 else game
272272 let nextPlayer = match getString(("next_player_" + gameId)) {
273273 case s: String =>
274274 s
275275 case _ =>
276276 PLAYER
277277 }
278278 if ((nextPlayer != PLAYER))
279279 then throw("AI hast to move first!")
280280 else {
281281 let currentBoard = match getString(("currentBoard_" + gameId)) {
282282 case s: String =>
283283 s
284284 case _ =>
285285 board
286286 }
287287 let initiator = match getString(("initiator_" + gameId)) {
288288 case s: String =>
289289 s
290290 case _ =>
291291 toString(sender)
292292 }
293293 if ((toString(sender) != initiator))
294294 then throw("Only initiator is allowed to make moves!")
295295 else {
296296 let moveOfPlayerIsValid = checkIfMoveIsValid(gameId, board)
297297 if (!(moveOfPlayerIsValid))
298298 then throw("Illegal move!")
299299 else {
300300 let playerHasWon = checkIfPlayerHasWon(gameId, board, PLAYER)
301301 let numberOfPossibleMoves = getPossibleMovesCount(board)
302302 if (playerHasWon)
303303 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "player"), ScriptTransfer(sender, WINNING_AMOUNT, BAI_ASSET_ID)]
304304 else if ((numberOfPossibleMoves == 0))
305305 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "draw")]
306306 else {
307307 let nextMove = invoke(Address(fromBase58String(BAI_CONTRACT)), "registerTaskCallback", [((gameId + "_") + board), "tictactoe", "callback"], [AttachedPayment(BAI_ASSET_ID, 10000000)])
308308 if ((nextMove == nextMove))
309309 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("initiator_" + gameId), toString(sender)), StringEntry(("winner_" + gameId), "none"), StringEntry(("next_player_" + gameId), AI)]
310310 else throw("Strict value is not equal to itself.")
311311 }
312312 }
313313 }
314314 }
315315 }
316316 }
317317 }
318318
319319
320320 @Verifier(tx)
321321 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
322322

github/deemru/w8io/026f985 
39.37 ms