Ocupada.py

def ocupada(numero_casilla): from Tablero import Tablero from posicion import posicion miposicion=posicion(numero_casilla) if Tablero[miposicion[0]][miposicion[1]]['loseta']==0: return(0) else: return(1)
Ocupada stands for taken up, Tablero stands for Board, and posicion stands for position. This snippet returns 1 if a tile is on a given square, and 0 if it's empty.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.