irene paniagua

Generation

generate functionFri, 07 Apr 2023

haz un tablero usando los caracteres de unicode en el rango u250C..u2573 e introduciendo el tablero que nos dan entre el. tablero=[[1,1,1,1],[2,2,2,2],[3,3,3,3]]

def make_board(board): id_str = "" for row in enumerate(board): row_str = "" for cell in enumerate(row[1]): if cell[0] == 0: row_str += u'\u250C' if cell[0] == len(row[1]) - 1: row_str += u'\u2510' else: row_str += u'\u2500' print(row_str) for cell in enumerate(row[1]): if cell[0] == 0: print(u'\u2502' + str(cell[1]) + u'\u2502', end='') else: print(str(cell[1]) + u'\u2502', end='') print('\n') if row[0] == 0: id_str += u'\u251C' if row[0] == len(board) - 1: id_

Want to kickstart your project?Use the new AI Studio to create your code