Home > Mobile >  Is it possible to update printed list without printing it again. Python
Is it possible to update printed list without printing it again. Python

Time:10-13

I'm making a clone game of tetris in console graphics. I have already created a board from lists, and my question is if it's possible to update the board without printing a new one? Or there is another way of making board cause it's my first time expreince so I'm not sure is that a right way. Would be grateful for answers. Here is my code:

lower_board,upper_board,board = ["|","_","_","_","_","_","_","_","|"],[" ","_","_","_","_","_","_","_"," "],[]
board.append(upper_board), [board.append(["|"," ", " "," ", " "," "," "," ","|"]) for i in range(0,6)], board.append(lower_board)
def show_board():
    for row in board:
      print("".join(row))
show_board()

CodePudding user response:

Due to the fact that the console is used to print out text and not really a graphics output I do not think there is any way you can do this without re printing the output.

  • Related