Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

c132c81c2ae1ad1156d9888e85646cfda42ea7d0850ce693466cd073faafcb65
Timestamp (utc)
2020-10-09 03:37:42
Fee Paid
0.00000236 BSV
(
0.00008440 BSV
-
0.00008204 BSV
)
Fee Rate
463.6 sat/KB
Version
1
Confirmations
342,431
Size Stats
509 B

2 Inputs

Total Input:
0.00008440 BSV
  • Q!r྿ýyXÏÚ÷Ë÷+¼ÝZDäw)ԂüVß§)C£M!Ë?o°Én“Åp•Òåöô Žãè-ùÛP/ /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 let temp = this.moves.slice()\n temp[position] = this.getSymbol()\n this.moves = temp\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":["0272e0bebffd7958cfdaf7cbf72bbcdd5a9d44e47729d482fc0656dfa72943a34d","03cb3f6fb018c91b006ec293c57095d2e5f6f40b8ee3e82d0f15f9db502fa00f2f"],"__func":"constructor"}u
    https://whatsonchain.com/tx/undefined

2 Outputs

Total Output:
0.00008204 BSV
  • Q!r྿ýyXÏÚ÷Ë÷+¼ÝZDäw)ԂüVß§)C£M!Ë?o°Én“Åp•Òåöô Žãè-ùÛP/ /R®Lw{"__index":{"obj":0},"__args":["0272e0bebffd7958cfdaf7cbf72bbcdd5a9d44e47729d482fc0656dfa72943a34d",1],"__func":"move"}u
    https://whatsonchain.com/tx/c132c81c2ae1ad1156d9888e85646cfda42ea7d0850ce693466cd073faafcb65