我非常喜欢菜鸟,所以请原谅我令人费解的混乱代码.我正在努力制作一个自己的游戏引擎,用于基于文本的战斗冒险等.这是代码:
import random
def drawBoard(board):
# This function prints out the board that it was passed.
# "board" is a list of 29 strings representing the board (ignore index 0)
print('|---+---+---+---+---+---+---|')
print('| | | | | | | |')
print('| ' + board[1] + ' | ' + board[2] + ' | ' + board[3] + ' | ' + board[4] + ' | ' + board[5] + ' | ' + board[6] + ' | ' + board[7] + …Run Code Online (Sandbox Code Playgroud)