Transaction #1203991

Hash 74e14aba4abab595bccc2e773986f0378964ba368ca66054d2fc9e54f21d46bd
Status Success
Timestamp 526 days ago - 12/8/2022, 1:26:47 PM UTC+0
Block 1154766
Stamps Used 720
Burned Fee 0.04260355 TAU
From ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 2502
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 1b68fef0c7ef78f56e3e677a3984047bad3e8182cd8c43f3924d8b9187fad11c2fa8fcff8ee64509cdb14d5cb27316b602b5f49cd89f1411b794c84780503107
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code # The game works as following (turn based): # The player wants to move to the bottom to win # The enemy tries to catch him before he reaches and wins # Should return a good formated map for telegram message import currency rooms = Hash(default_value=False) operator = Variable() p = "Player" c = "Collider" e = "Enemy" f = "Finish" @construct def seed(): operator.set("ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89") @export def change_op(op:str): assert operator.get() == ctx.caller, "Only op can change it" operator.set(op) @export def createGame(roomName: str, wager: float): assert roomName != "", "The room name cannot be empty" assert rooms[roomName] == False, "There is already a room with that name" assert wager > 0, "Wager needs to be more than 0" currency.transfer_from(amount=wager, to=ctx.this, main_account=ctx.caller) rooms[roomName, "state"] = "waiting" rooms[roomName, "winner"] = "" rooms[roomName, "player"] = ctx.caller rooms[roomName, "enemy"] = "" rooms[roomName, "turn"] = "Enemy" rooms[roomName, "p_position"] = 20 rooms[roomName, "e_position"] = 113 rooms[roomName, "map"] = [ c, c, c, c, c, c, c, c, c, c, c, c, c, c, 0, 0, 0, 0, 0, p, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, c, 0, 0, 0, 0, 0, c, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, c, 0, 0, 0, 0, 0, c, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, c, f, f, f, f, f, f, f, f, f, f, f, f, f ] rooms[roomName, "pot"] = wager printable_map = "" i = 0 for tile in rooms[roomName, "map"]: abbreviation = tile if(tile == "Enemy"): abbreviation = "E" if(tile == "Collider"): abbreviation = "C" if(tile == "Player"): abbreviation = "P" if(tile == "Finish"): abbreviation = "F" if i % 13 == 0: printable_map += '\n' printable_map += str(f" {abbreviation}") i+=1 return printable_map @export def joinGame(roomName:str): assert rooms[roomName] != False, "There is no room with that name" assert rooms[roomName, "enemy"] == "", "Room is full" assert rooms[roomName, "state"] == "waiting", "Room is full" currency.transfer_from(amount=rooms[roomName, "pot"], to=ctx.this, main_account=ctx.caller) rooms[roomName, "pot"] *= 2 rooms[roomName, "enemy"] == ctx.caller rooms[roomName, "state"] = "playing" printable_map = "" i = 0 for tile in rooms[roomName, "map"]: abbreviation = tile if(tile == "Enemy"): abbreviation = "E" if(tile == "Collider"): abbreviation = "C" if(tile == "Player"): abbreviation = "P" if(tile == "Finish"): abbreviation = "F" if i % 13 == 0: printable_map += '\n' printable_map += str(f" {abbreviation}") i+=1 return printable_map @export def move(roomName:str, direction:str): assert rooms[roomName] != False, "There is no room with that name" assert rooms[roomName, "enemy"] == ctx.caller or rooms[roomName, "player"] == ctx.caller, "You are not a player in that room" assert rooms[roomName, "winner"] == "", "This game ended already." assert rooms[roomName, "state"] == "playing", "This game ended already." room_map = rooms[roomName, "map"] if rooms[roomName, "enemy"] == ctx.caller: assert rooms[roomName, "turn"] == "Enemy", "Its not your turn" if direction == "left": assert room_map[rooms[roomName, "e_position"] - 1] != c, "You cannot move there" assert room_map[rooms[roomName, "e_position"] - 1] != f, "You cannot move there" if(room_map[rooms[roomName, "e_position"] - 1] == 0): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] - 1] = e rooms[roomName, "e_position"] -= 1 if(room_map[rooms[roomName, "e_position"] - 1] == p): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] - 1] = e rooms[roomName, "e_position"] -= 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if direction == "right": assert room_map[rooms[roomName, "e_position"] + 1] != c, "You cannot move there" assert room_map[rooms[roomName, "e_position"] + 1] != f, "You cannot move there" if(room_map[rooms[roomName, "e_position"] + 1] == 0): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] + 1] = e rooms[roomName, "e_position"] += 1 if(room_map[rooms[roomName, "e_position"] + 1] == p): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] + 1] = e rooms[roomName, "e_position"] += 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if direction == "down": assert rooms[roomName, "e_position"] + 13 <= 155, "You cannot move there" assert room_map[rooms[roomName, "e_position"] + 13] != c, "You cannot move there" assert room_map[rooms[roomName, "e_position"] + 13] != f, "You cannot move there" if(room_map[rooms[roomName, "e_position"] + 13] == 0): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] + 13] = e rooms[roomName, "e_position"] += 13 if(room_map[rooms[roomName, "e_position"] + 13] == p): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] + 13] = e rooms[roomName, "e_position"] += 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if direction == "up": assert rooms[roomName, "e_position"] - 13 >= 0, "You cannot move there" assert room_map[rooms[roomName, "e_position"] - 13] != c, "You cannot move there" assert room_map[rooms[roomName, "e_position"] - 13] != f, "You cannot move there" if(room_map[rooms[roomName, "e_position"] - 13] == 0): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] - 13] = e rooms[roomName, "e_position"] -= 13 if(room_map[rooms[roomName, "e_position"] - 13] == p): room_map[rooms[roomName, "e_position"]] = 0 room_map[rooms[roomName, "e_position"] - 13] = e rooms[roomName, "e_position"] -= 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] rooms[roomName, "turn"] = "Player" if rooms[roomName, "player"] == ctx.caller: assert rooms[roomName, "turn"] == "Player", "Its not your turn" if direction == "left": assert room_map[rooms[roomName, "p_position"] - 1] != c, "You cannot move there" if(room_map[rooms[roomName, "p_position"] - 1] == 0): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 1] = e rooms[roomName, "p_position"] -= 1 if(room_map[rooms[roomName, "p_position"] - 1] == p): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 1] = e rooms[roomName, "p_position"] -= 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if(room_map[rooms[roomName, "p_position"] - 1] == f): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 1] = e rooms[roomName, "p_position"] -= 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "player"] if direction == "right": assert room_map[rooms[roomName, "p_position"] + 1] != c, "You cannot move there" if(room_map[rooms[roomName, "p_position"] + 1] == 0): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 1] = e rooms[roomName, "p_position"] += 1 if(room_map[rooms[roomName, "p_position"] + 1] == p): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 1] = e rooms[roomName, "p_position"] += 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if(room_map[rooms[roomName, "p_position"] + 1] == f): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 1] = e rooms[roomName, "p_position"] += 1 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "player"] if direction == "down": assert rooms[roomName, "p_position"] + 13 <= 155, "You cannot move there" assert room_map[rooms[roomName, "p_position"] + 13] != c, "You cannot move there" if(room_map[rooms[roomName, "p_position"] + 13] == 0): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 13] = e rooms[roomName, "p_position"] += 13 if(room_map[rooms[roomName, "p_position"] + 13] == p): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 13] = e rooms[roomName, "p_position"] += 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if(room_map[rooms[roomName, "p_position"] + 13] == f): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] + 13] = e rooms[roomName, "p_position"] += 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "player"] if direction == "up": assert rooms[roomName, "p_position"] - 13 >= 0, "You cannot move there" assert room_map[rooms[roomName, "p_position"] - 13] != c, "You cannot move there" if(room_map[rooms[roomName, "p_position"] - 13] == 0): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 13] = e rooms[roomName, "p_position"] -= 13 if(room_map[rooms[roomName, "p_position"] - 13] == p): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 13] = e rooms[roomName, "p_position"] -= 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "enemy"] if(room_map[rooms[roomName, "p_position"] - 13] == f): room_map[rooms[roomName, "p_position"]] = 0 room_map[rooms[roomName, "p_position"] - 13] = e rooms[roomName, "p_position"] -= 13 rooms[roomName, "state"] = "ended" rooms[roomName, "winner"] = rooms[roomName, "player"] rooms[roomName, "turn"] = "Enemy" rooms[roomName, "map"] = room_map if rooms[roomName, "state"] == "playing": printable_map = "" i = 0 for tile in room_map: abbreviation = tile if(tile == "Enemy"): abbreviation = "E" if(tile == "Collider"): abbreviation = "C" if(tile == "Player"): abbreviation = "P" if(tile == "Finish"): abbreviation = "F" if i % 13 == 0: printable_map += '\n' printable_map += str(f" {abbreviation}") i+=1 return printable_map if rooms[roomName, "state"] == "ended": currency_to_transfer_to_winner = rooms[roomName, "pot"] / 100 * 98 currency_to_transfer_to_op = rooms[roomName, "pot"] - currency_to_transfer_to_winner currency.transfer(amount=currency_to_transfer_to_winner, to=rooms[roomName, "winner"]) currency.transfer(amount=currency_to_transfer_to_op, to=operator.get()) return f"The winner is {rooms[roomName, 'winner']}"
name con_tg_game

State Changes

Contract con_tg_game
Variable operator
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract con_tg_game
Variable __code__
New Value import currency __rooms = Hash(default_value=False, contract='con_tg_game', name='rooms') __operator = Variable(contract='con_tg_game', name='operator') p = 'Player' c = 'Collider' e = 'Enemy' f = 'Finish' def ____(): __operator.set( 'ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89') @__export('con_tg_game') def change_op(op: str): assert __operator.get() == ctx.caller, 'Only op can change it' __operator.set(op) @__export('con_tg_game') def createGame(roomName: str, wager: float): assert roomName != '', 'The room name cannot be empty' assert __rooms[roomName] == False, 'There is already a room with that name' assert wager > 0, 'Wager needs to be more than 0' currency.transfer_from(amount=wager, to=ctx.this, main_account=ctx.caller) __rooms[roomName, 'state'] = 'waiting' __rooms[roomName, 'winner'] = '' __rooms[roomName, 'player'] = ctx.caller __rooms[roomName, 'enemy'] = '' __rooms[roomName, 'turn'] = 'Enemy' __rooms[roomName, 'p_position'] = 20 __rooms[roomName, 'e_position'] = 113 __rooms[roomName, 'map'] = [c, c, c, c, c, c, c, c, c, c, c, c, c, c, 0, 0, 0, 0, 0, p, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, c, 0, 0, 0, 0, 0, c, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, c, 0, 0, 0, 0, 0, c, 0, 0, c, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, c, c, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, c, f, f, f, f, f, f, f, f, f, f, f, f, f] __rooms[roomName, 'pot'] = wager printable_map = '' i = 0 for tile in __rooms[roomName, 'map']: abbreviation = tile if tile == 'Enemy': abbreviation = 'E' if tile == 'Collider': abbreviation = 'C' if tile == 'Player': abbreviation = 'P' if tile == 'Finish': abbreviation = 'F' if i % 13 == 0: printable_map += '\n' printable_map += str(f' {abbreviation}') i += 1 return printable_map @__export('con_tg_game') def joinGame(roomName: str): assert __rooms[roomName] != False, 'There is no room with that name' assert __rooms[roomName, 'enemy'] == '', 'Room is full' assert __rooms[roomName, 'state'] == 'waiting', 'Room is full' currency.transfer_from(amount=__rooms[roomName, 'pot'], to=ctx.this, main_account=ctx.caller) __rooms[roomName, 'pot'] *= 2 __rooms[roomName, 'enemy'] == ctx.caller __rooms[roomName, 'state'] = 'playing' printable_map = '' i = 0 for tile in __rooms[roomName, 'map']: abbreviation = tile if tile == 'Enemy': abbreviation = 'E' if tile == 'Collider': abbreviation = 'C' if tile == 'Player': abbreviation = 'P' if tile == 'Finish': abbreviation = 'F' if i % 13 == 0: printable_map += '\n' printable_map += str(f' {abbreviation}') i += 1 return printable_map @__export('con_tg_game') def move(roomName: str, direction: str): assert __rooms[roomName] != False, 'There is no room with that name' assert __rooms[roomName, 'enemy'] == ctx.caller or __rooms[roomName, 'player'] == ctx.caller, 'You are not a player in that room' assert __rooms[roomName, 'winner'] == '', 'This game ended already.' assert __rooms[roomName, 'state'] == 'playing', 'This game ended already.' room_map = __rooms[roomName, 'map'] if __rooms[roomName, 'enemy'] == ctx.caller: assert __rooms[roomName, 'turn'] == 'Enemy', 'Its not your turn' if direction == 'left': assert room_map[__rooms[roomName, 'e_position'] - 1 ] != c, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] - 1 ] != f, 'You cannot move there' if room_map[__rooms[roomName, 'e_position'] - 1] == 0: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] - 1] = e __rooms[roomName, 'e_position'] -= 1 if room_map[__rooms[roomName, 'e_position'] - 1] == p: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] - 1] = e __rooms[roomName, 'e_position'] -= 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if direction == 'right': assert room_map[__rooms[roomName, 'e_position'] + 1 ] != c, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] + 1 ] != f, 'You cannot move there' if room_map[__rooms[roomName, 'e_position'] + 1] == 0: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] + 1] = e __rooms[roomName, 'e_position'] += 1 if room_map[__rooms[roomName, 'e_position'] + 1] == p: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] + 1] = e __rooms[roomName, 'e_position'] += 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if direction == 'down': assert __rooms[roomName, 'e_position' ] + 13 <= 155, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] + 13 ] != c, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] + 13 ] != f, 'You cannot move there' if room_map[__rooms[roomName, 'e_position'] + 13] == 0: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] + 13] = e __rooms[roomName, 'e_position'] += 13 if room_map[__rooms[roomName, 'e_position'] + 13] == p: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] + 13] = e __rooms[roomName, 'e_position'] += 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if direction == 'up': assert __rooms[roomName, 'e_position' ] - 13 >= 0, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] - 13 ] != c, 'You cannot move there' assert room_map[__rooms[roomName, 'e_position'] - 13 ] != f, 'You cannot move there' if room_map[__rooms[roomName, 'e_position'] - 13] == 0: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] - 13] = e __rooms[roomName, 'e_position'] -= 13 if room_map[__rooms[roomName, 'e_position'] - 13] == p: room_map[__rooms[roomName, 'e_position']] = 0 room_map[__rooms[roomName, 'e_position'] - 13] = e __rooms[roomName, 'e_position'] -= 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] __rooms[roomName, 'turn'] = 'Player' if __rooms[roomName, 'player'] == ctx.caller: assert __rooms[roomName, 'turn'] == 'Player', 'Its not your turn' if direction == 'left': assert room_map[__rooms[roomName, 'p_position'] - 1 ] != c, 'You cannot move there' if room_map[__rooms[roomName, 'p_position'] - 1] == 0: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 1] = e __rooms[roomName, 'p_position'] -= 1 if room_map[__rooms[roomName, 'p_position'] - 1] == p: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 1] = e __rooms[roomName, 'p_position'] -= 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if room_map[__rooms[roomName, 'p_position'] - 1] == f: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 1] = e __rooms[roomName, 'p_position'] -= 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'player'] if direction == 'right': assert room_map[__rooms[roomName, 'p_position'] + 1 ] != c, 'You cannot move there' if room_map[__rooms[roomName, 'p_position'] + 1] == 0: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 1] = e __rooms[roomName, 'p_position'] += 1 if room_map[__rooms[roomName, 'p_position'] + 1] == p: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 1] = e __rooms[roomName, 'p_position'] += 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if room_map[__rooms[roomName, 'p_position'] + 1] == f: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 1] = e __rooms[roomName, 'p_position'] += 1 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'player'] if direction == 'down': assert __rooms[roomName, 'p_position' ] + 13 <= 155, 'You cannot move there' assert room_map[__rooms[roomName, 'p_position'] + 13 ] != c, 'You cannot move there' if room_map[__rooms[roomName, 'p_position'] + 13] == 0: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 13] = e __rooms[roomName, 'p_position'] += 13 if room_map[__rooms[roomName, 'p_position'] + 13] == p: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 13] = e __rooms[roomName, 'p_position'] += 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if room_map[__rooms[roomName, 'p_position'] + 13] == f: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] + 13] = e __rooms[roomName, 'p_position'] += 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'player'] if direction == 'up': assert __rooms[roomName, 'p_position' ] - 13 >= 0, 'You cannot move there' assert room_map[__rooms[roomName, 'p_position'] - 13 ] != c, 'You cannot move there' if room_map[__rooms[roomName, 'p_position'] - 13] == 0: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 13] = e __rooms[roomName, 'p_position'] -= 13 if room_map[__rooms[roomName, 'p_position'] - 13] == p: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 13] = e __rooms[roomName, 'p_position'] -= 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'enemy'] if room_map[__rooms[roomName, 'p_position'] - 13] == f: room_map[__rooms[roomName, 'p_position']] = 0 room_map[__rooms[roomName, 'p_position'] - 13] = e __rooms[roomName, 'p_position'] -= 13 __rooms[roomName, 'state'] = 'ended' __rooms[roomName, 'winner'] = __rooms[roomName, 'player'] __rooms[roomName, 'turn'] = 'Enemy' __rooms[roomName, 'map'] = room_map if __rooms[roomName, 'state'] == 'playing': printable_map = '' i = 0 for tile in room_map: abbreviation = tile if tile == 'Enemy': abbreviation = 'E' if tile == 'Collider': abbreviation = 'C' if tile == 'Player': abbreviation = 'P' if tile == 'Finish': abbreviation = 'F' if i % 13 == 0: printable_map += '\n' printable_map += str(f' {abbreviation}') i += 1 return printable_map if __rooms[roomName, 'state'] == 'ended': currency_to_transfer_to_winner = __rooms[roomName, 'pot'] / 100 * 98 currency_to_transfer_to_op = __rooms[roomName, 'pot' ] - currency_to_transfer_to_winner currency.transfer(amount=currency_to_transfer_to_winner, to=__rooms [roomName, 'winner']) currency.transfer(amount=currency_to_transfer_to_op, to=__operator. get()) return f"The winner is {__rooms[roomName, 'winner']}"
 
Contract con_tg_game
Variable __compiled__
New Value e30000000000000000000000000500000040000000739a000000640064016c005a00650164026403640464058d035a0265036403640664078d025a0464085a0564095a06640a5a07640b5a08640c640d84005a09650a64038301650b640e9c01640f6410840483015a0c650a64038301650b650d64119c0264126413840483015a0e650a64038301650b64149c0164156416840483015a0f650a64038301650b650b64179c0264186419840483015a1064015300291ae9000000004e46da0b636f6e5f74675f67616d65da05726f6f6d732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086f70657261746f72290272050000007206000000da06506c61796572da08436f6c6c69646572da05456e656d79da0646696e697368630000000000000000000000000200000043000000730e00000074006a016401830101006400530029024eda40666636313534346561393465616165623564663038656438363363346139333865393132396162613663656565356633316236363831626465646531316238392902da0a5f5f6f70657261746f72da03736574a900720f000000720f000000da00da045f5f5f5f0a00000073040000000001040172110000002901da026f70630100000000000000010000000200000043000000732400000074006a01830074026a036b027316740464018301820174006a057c00830101006400530029024e7a154f6e6c79206f702063616e206368616e67652069742906720d000000da03676574da03637478da0663616c6c6572da0e417373657274696f6e4572726f72720e00000029017212000000720f000000720f0000007210000000da096368616e67655f6f700f00000073040000000002160172170000002902da08726f6f6d4e616d65da057761676572630200000000000000060000009c00000043000000737e0200007c0064016b037310740064028301820174017c00190064036b02732474006404830182017c0164056b047334740064068301820174026a037c0174046a0574046a0664078d030100640874017c00640966023c00640174017c00640a66023c0074046a0674017c00640b66023c00640174017c00640c66023c00640d74017c00640e66023c00640f74017c00641066023c00641174017c00641266023c0074077407740774077407740774077407740774077407740774077407640564056405640564057408640564056405640564057407740764056405640564056405640564056405640564056405740774076405640574076405640564056405640574076405640574077407640564056405640564056405640564056405640564057407740764056405640564056405640564056405640564056405740774076405640564056405640564056405640564056405640574077407640564056405640564056405640564056405640564057407740764056405740764056405640564056405740764056405740774076405640564056405640564056405640564056405640574077407640564056405640564057409640564056405640564057407740a740a740a740a740a740a740a740a740a740a740a740a740a679c74017c00641366023c007c0174017c00641466023c0064017d0264057d03788274017c0064136602190044005d727d047c047d057c04640d6b029002721a64157d057c0464166b029002722864177d057c0464186b029002723664197d057c04641a6b0290027244641b7d057c03641c160064056b029002725a7c02641d37007d027c02740b641e7c059b009d02830137007d027c03641f37007d039002710457007c02530029204e72100000007a1d54686520726f6f6d206e616d652063616e6e6f7420626520656d707479467a26546865726520697320616c7265616479206120726f6f6d20776974682074686174206e616d6572010000007a1d5761676572206e6565647320746f206265206d6f7265207468616e20302903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e74da0777616974696e67da057374617465da0677696e6e6572da06706c61796572da05656e656d79720a000000da047475726ee914000000da0a705f706f736974696f6ee971000000da0a655f706f736974696f6eda036d6170da03706f74da01457209000000da01437208000000da0150720b000000da0146e90d000000da010afa0120e901000000290c7216000000da075f5f726f6f6d73da0863757272656e6379da0d7472616e736665725f66726f6d7214000000da04746869737215000000da0163da0170da0165da0166da03737472290672180000007219000000da0d7072696e7461626c655f6d6170da0169da0474696c65da0c616262726576696174696f6e720f000000720f0000007210000000da0a63726561746547616d6515000000734a000000000210011401100114010c010c010e010c010c010c010c011e012e012e012e012e012e012e0112010c0104010401120104010a0104010a0104010a0104010a0104010e01080112010e01723e00000029017218000000630100000000000000050000000500000043000000731601000074007c00190064016b037314740164028301820174007c0064036602190064046b02732c740164058301820174007c0064066602190064076b027344740164058301820174026a0374007c0064086602190074046a0574046a0664098d03010074007c006408660205001900640a390003003c0074007c0064036602190074046a066b020100640b74007c00640666023c0064047d01640c7d02787674007c00640d6602190044005d667d037c037d047c03640e6b0272bc640f7d047c0364106b0272c864117d047c0364126b0272d464137d047c0364146b0272e064157d047c0264161600640c6b0272f47c01641737007d017c01740764187c049b009d02830137007d017c02641937007d0271a857007c015300291a4e467a1f5468657265206973206e6f20726f6f6d20776974682074686174206e616d65722100000072100000007a0c526f6f6d2069732066756c6c721e000000721d00000072280000002903721a000000721b000000721c000000e902000000da07706c6179696e6772010000007227000000720a00000072290000007209000000722a0000007208000000722b000000720b000000722c000000722d000000722e000000722f000000723000000029087231000000721600000072320000007233000000721400000072340000007215000000723900000029057218000000723a000000723b000000723c000000723d000000720f000000720f0000007210000000da086a6f696e47616d653e0000007332000000000214011801180112010a01140112010c010401040112010401080104010801040108010401080104010c01080112010c01724100000029027218000000da09646972656374696f6e630200000000000000090000000500000043000000734c0c000074007c00190064016b037314740164028301820174007c0064036602190074026a036b02734074007c0064046602190074026a036b027340740164058301820174007c0064066602190064076b027358740164088301820174007c00640966021900640a6b027370740164088301820174007c00640b660219007d0274007c0064036602190074026a036b029005723474007c00640c66021900640d6b0273a87401640e830182017c01640f6b02900172b67c0274007c0064106602190064111800190074046b0373d274016412830182017c0274007c0064106602190064111800190074056b0373f274016412830182017c0274007c0064106602190064111800190064136b029001724464137c0274007c006410660219003c0074067c0274007c00641066021900641118003c0074007c0064106602050019006411380003003c007c0274007c0064106602190064111800190074076b02900172b664137c0274007c006410660219003c0074067c0274007c00641066021900641118003c0074007c0064106602050019006411380003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0164156b02900272c87c0274007c0064106602190064111700190074046b03900173e274016412830182017c0274007c0064106602190064111700190074056b039002730474016412830182017c0274007c0064106602190064111700190064136b029002725664137c0274007c006410660219003c0074067c0274007c00641066021900641117003c0074007c0064106602050019006411370003003c007c0274007c0064106602190064111700190074076b02900272c864137c0274007c006410660219003c0074067c0274007c00641066021900641117003c0074007c0064106602050019006411370003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0164166b02900372f874007c006410660219006417170064186b01900273f074016412830182017c0274007c0064106602190064171700190074046b039003731274016412830182017c0274007c0064106602190064171700190074056b039003733474016412830182017c0274007c0064106602190064171700190064136b029003728664137c0274007c006410660219003c0074067c0274007c00641066021900641717003c0074007c0064106602050019006417370003003c007c0274007c0064106602190064171700190074076b02900372f864137c0274007c006410660219003c0074067c0274007c00641066021900641717003c0074007c0064106602050019006417370003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0164196b029005722874007c006410660219006417180064136b059004732074016412830182017c0274007c0064106602190064171800190074046b039004734274016412830182017c0274007c0064106602190064171800190074056b039004736474016412830182017c0274007c0064106602190064171800190064136b02900472b664137c0274007c006410660219003c0074067c0274007c00641066021900641718003c0074007c0064106602050019006417380003003c007c0274007c0064106602190064171800190074076b029005722864137c0274007c006410660219003c0074067c0274007c00641066021900641718003c0074007c0064106602050019006417380003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c00641a74007c00640c66023c0074007c0064046602190074026a036b02900b723274007c00640c66021900641a6b02900573627401640e830182017c01640f6b02900672c47c0274007c00641b6602190064111800190074046b039005738e74016412830182017c0274007c00641b6602190064111800190064136b02900572e064137c0274007c00641b660219003c0074067c0274007c00641b66021900641118003c0074007c00641b6602050019006411380003003c007c0274007c00641b6602190064111800190074076b029006725264137c0274007c00641b660219003c0074067c0274007c00641b66021900641118003c0074007c00641b6602050019006411380003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0274007c00641b6602190064111800190074056b02900672c464137c0274007c00641b660219003c0074067c0274007c00641b66021900641118003c0074007c00641b6602050019006411380003003c00641474007c00640966023c0074007c0064046602190074007c00640666023c007c0164156b02900872267c0274007c00641b6602190064111700190074046b03900673f074016412830182017c0274007c00641b6602190064111700190064136b029007724264137c0274007c00641b660219003c0074067c0274007c00641b66021900641117003c0074007c00641b6602050019006411370003003c007c0274007c00641b6602190064111700190074076b02900772b464137c0274007c00641b660219003c0074067c0274007c00641b66021900641117003c0074007c00641b6602050019006411370003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0274007c00641b6602190064111700190074056b029008722664137c0274007c00641b660219003c0074067c0274007c00641b66021900641117003c0074007c00641b6602050019006411370003003c00641474007c00640966023c0074007c0064046602190074007c00640666023c007c0164166b02900972a674007c00641b660219006417170064186b019008734e74016412830182017c0274007c00641b6602190064171700190074046b039008737074016412830182017c0274007c00641b6602190064171700190064136b02900872c264137c0274007c00641b660219003c0074067c0274007c00641b66021900641717003c0074007c00641b6602050019006417370003003c007c0274007c00641b6602190064171700190074076b029009723464137c0274007c00641b660219003c0074067c0274007c00641b66021900641717003c0074007c00641b6602050019006417370003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0274007c00641b6602190064171700190074056b02900972a664137c0274007c00641b660219003c0074067c0274007c00641b66021900641717003c0074007c00641b6602050019006417370003003c00641474007c00640966023c0074007c0064046602190074007c00640666023c007c0164196b02900b722674007c00641b660219006417180064136b05900973ce74016412830182017c0274007c00641b6602190064171800190074046b03900973f074016412830182017c0274007c00641b6602190064171800190064136b02900a724264137c0274007c00641b660219003c0074067c0274007c00641b66021900641718003c0074007c00641b6602050019006417380003003c007c0274007c00641b6602190064171800190074076b02900a72b464137c0274007c00641b660219003c0074067c0274007c00641b66021900641718003c0074007c00641b6602050019006417380003003c00641474007c00640966023c0074007c0064036602190074007c00640666023c007c0274007c00641b6602190064171800190074056b02900b722664137c0274007c00641b660219003c0074067c0274007c00641b66021900641718003c0074007c00641b6602050019006417380003003c00641474007c00640966023c0074007c0064046602190074007c00640666023c00640d74007c00640c66023c007c0274007c00640b66023c0074007c00640966021900640a6b02900b72d864077d0364137d04787a7c0244005d727d057c057d067c05640d6b02900b7274641c7d067c05641d6b02900b7282641e7d067c05641a6b02900b7290641f7d067c0564206b02900b729e64217d067c046417160064136b02900b72b47c03642237007d037c03740864237c069b009d02830137007d037c04641137007d04900b715e57007c03530074007c0064096602190064146b02900c724874007c0064246602190064251b00642614007d0774007c006424660219007c0718007d0874096a0a7c0774007c0064066602190064278d02010074096a0a7c08740b6a0c830064278d020100642874007c006406660219009b009d0253006400530029294e467a1f5468657265206973206e6f20726f6f6d20776974682074686174206e616d65722100000072200000007a21596f7520617265206e6f74206120706c6179657220696e207468617420726f6f6d721f00000072100000007a18546869732067616d6520656e64656420616c72656164792e721e000000724000000072270000007222000000720a0000007a11497473206e6f7420796f7572207475726eda046c656674722600000072300000007a15596f752063616e6e6f74206d6f76652074686572657201000000da05656e646564da057269676874da04646f776e722d000000e99b000000da0275707208000000722400000072290000007209000000722a000000722b000000720b000000722c000000722e000000722f0000007228000000e964000000e9620000002902721a000000721b0000007a0e5468652077696e6e657220697320290d7231000000721600000072140000007215000000723500000072380000007237000000723600000072390000007232000000da087472616e73666572720d0000007213000000290972180000007242000000da08726f6f6d5f6d6170723a000000723b000000723c000000723d000000da1e63757272656e63795f746f5f7472616e736665725f746f5f77696e6e6572da1a63757272656e63795f746f5f7472616e736665725f746f5f6f70720f000000720f0000007210000000da046d6f76655b000000736e0100000002140116011601180118010c01140118010a0112010e0112010e011a011001140114011a011001140114010c0114010a0112011001120110011a011001140114011a011001140114010c0114010a010a01140112011001120110011a011001140114011a011001140114010c0114010a010a01140112011001120110011a011001140114011a011001140114010c0114010c0114011a010a01120110011a011001140114011a011001140114010c0114011a011001140114010c0114010a01120110011a011001140114011a011001140114010c0114011a011001140114010c0114010a010a011401120110011a011001140114011a011001140114010c0114011a011001140114010c0114010a010a011401120110011a011001140114011a011001140114010c0114011a011001140114010c0114010c010c011201040104010a0104010a0104010a0104010a0104010a0104010e01080112010e010401120114010a01060108010e011202724f00000029117232000000da04486173687231000000da085661726961626c65720d00000072360000007235000000723700000072380000007211000000da085f5f6578706f727472390000007217000000da05666c6f6174723e0000007241000000724f000000720f000000720f000000720f0000007210000000da083c6d6f64756c653e01000000731e00000008010e010c010401040104010403080506011005060112280601101c0601
 
Contract con_tg_game
Variable __owner__
New Value null
 
Contract con_tg_game
Variable __submitted__
New Value 2022,12,8,13,26,48,0
 
Contract con_tg_game
Variable __developer__
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract currency
Variable balances
Key ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
New Value 47.030884406912751217389194285358