# Advanced game of Tic Tac Toe
# Author: Bob
# Version: TypeError
#******************************
#import modules
import random
import mcommandline
#******************************
class Human(object):
def __init__(self):
self.hposition = 0
self.hmove = ["X", self.hposition]
self.question = ""
def makemove(self):
self.hmove[1] = input("1-9: ")
def question():
question = input("Yes/No: ").lower()
class Board(object,Human()):
def __init__(self):
self.board = []
self.mark = []
def makeboard(self):
for i in range(9):
self.mark.append(i)
self.board.append((("["+str(self.mark[0])+"]"),("["+str(self.mark[1])+"]"),("["+str(self.mark[2])+"]")))
self.board.append((("["+str(self.mark[3])+"]"),("["+str(self.mark[4])+"]"),("["+str(self.mark[5])+"]")))
self.board.append((("["+str(self.mark[6])+"]"),("["+str(self.mark[7])+"]"),("["+str(self.mark[8])+"]")))
def printboard(self):
print(self.board[0][0],self.board[0][1],self.board[0][2])
print(self.board[1][0],self.board[1][1],self.board[1][2])
print(self.board[2][0],self.board[2][1],self.board[2][2])
def addmove(self):
self.mark[int(self.hmove[0])].pop
self.mark[int(self.hmove[0])].append(self.hmove[1])
def checkwin():
pass
#startup
Board = Board()
Board.makeboard()
Board.printboard()
Human = Human()
def Round():
Human.makemove()
Board.addmove()
Board.printboard()
Round()
I wanted to get the hang of class inheritance, with the most original idea ever I embarked on this quest...
So.. I have an error:
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
-I do not know what this means.
-More precisely I do not know what metaclasses mean
-You may comment on my dreadful make board function lol
-Could I have a fix for this I guess this is just going to be a small snippet of code that needs fixing rather than the whole program, I prefer learning by examples along with an explantion of what I did wrong if you would be kind to do so please :)
Many Thanks!