Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

d7fe431f4e2fdd29feef691d8f0d7f0b9f7de5315a9f882ebd0b29052de8d808
Timestamp (utc)
2020-10-04 18:10:52
Fee Paid
0.00000236 BSV
(
0.00077026 BSV
-
0.00076790 BSV
)
Fee Rate
465.4 sat/KB
Version
1
Confirmations
339,014
Size Stats
507 B

2 Inputs

Total Input:
0.00077026 BSV
  • Q!(P#×Ü<ª^f•V£µ8|>àrã9 ækŽhxdÑ!›Ý‘ ºÂ¨Iܸÿ§eoí}€rñù¡æê=R®MÍ {"__cls":"class TicTacToe{\n constructor(player1PK, player2PK){\n this._owners= [player1PK, player2PK]\n this.player1 = player1PK\n this.player2 = player2PK\n this.moves = [\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"]\n this.mover = 0\n this.winner = null\n }\n\n getSymbol(){\n if(this.mover === 1){return \"X\"}\n return \"O\"\n }\n\n reassignMover(moverPk){\n if(this.mover === 0){this.mover = 1}\n else{this.mover = 0}\n }\n\n move(playerPK, position){\n if(this.winner !== null){throw new Error('This game is over')}\n if((this.mover === 0 && playerPK === this.player1) || (this.mover === 1 && playerPK === this.player2)){\n if (this.moves[position] === \"0\"){\n this.moves[position] = this.getSymbol()\n }else{throw new Error('That space is already taken.')}\n }else{throw new Error(\"It is not your turn. \")}\n this.checkForWinner(playerPK)\n this.reassignMover(playerPK)\n }\n\n getAllIndexes(arr, val) {\n var indexes = [], i = -1;\n while ((i = arr.indexOf(val, i+1)) !== -1){\n indexes.push(i);\n }\n return indexes;\n }\n\n checkForWinner(playerPK){\n let symbol = this.getSymbol()\n let indexes = this.getAllIndexes(this.moves, symbol)\n \n //HorizontalWinner \n if(indexes.includes(0) && indexes.includes(1) && indexes.includes(2) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n if(indexes.includes(3) && indexes.includes(4) && indexes.includes(5) && indexes[0] !== \"0\"){this.winner = playerPK; return }\n if(indexes.includes(6) && indexes.includes(7) && indexes.includes(8) && indexes[0] !== \"0\"){this.winner = playerPK; return }\n\n //Vertical Winner\n if(indexes.includes(0) && indexes.includes(3) && indexes.includes(6) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n if(indexes.includes(1) && indexes.includes(4) && indexes.includes(7) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n if(indexes.includes(2) && indexes.includes(5) && indexes.includes(8) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n\n //Diagonal Winner \n if(indexes.includes(0) && indexes.includes(4) && indexes.includes(8) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n if(indexes.includes(2) && indexes.includes(4) && indexes.includes(6) && indexes[0] !== \"0\"){this.winner = playerPK; return}\n }\n}","__index":{"obj":0},"__args":["03285023d7dc3c06aa125e66955605a3b5387c3ee072e33920e66b1b8e687864d1","029bdd910b18bac2a849dc000510b8ffa7656fed7d8072f1f9a11e178118e6ea3d"],"__func":"constructor"}u
    https://whatsonchain.com/tx/undefined

2 Outputs

Total Output:
0.00076790 BSV
  • Q!(P#×Ü<ª^f•V£µ8|>àrã9 ækŽhxdÑ!›Ý‘ ºÂ¨Iܸÿ§eoí}€rñù¡æê=R®Lw{"__index":{"obj":0},"__args":["03285023d7dc3c06aa125e66955605a3b5387c3ee072e33920e66b1b8e687864d1",5],"__func":"move"}u
    https://whatsonchain.com/tx/d7fe431f4e2fdd29feef691d8f0d7f0b9f7de5315a9f882ebd0b29052de8d808