class KingTask(Task): id = 'king' tests = [ Test(id='01', time=3.0, score=10.0, dat=None, chk=None), Test(id='02', time=3.0, score=10.0, dat=None, chk=None), Test(id='03', time=3.0, score=10.0, dat=None, chk=None), Test(id='04', time=3.0, score=10.0, dat=None, chk=None), Test(id='05', time=3.0, score=10.0, dat=None, chk=None), Test(id='06', time=3.0, score=10.0, dat=None, chk=None), Test(id='07', time=3.0, score=10.0, dat=None, chk=None), Test(id='08', time=3.0, score=10.0, dat=None, chk=None), Test(id='09', time=3.0, score=10.0, dat=None, chk=None), Test(id='10', time=3.0, score=10.0, dat=None, chk=None), ] def load_dat(self, stream): table = [] for k in range(8): a,b,c,d,e,f,g,h = self.read(stream,int,int,int,int,int,int,int,int) table.append((a,b,c,d,e,f,g,h)) return Dat(table=table) def load_chk(self, stream): return Chk(X=self.read(stream, int)) def save_dat(self, stream, dat): for a,b,c,d,e,f,g,h in dat.table: self.write(stream,a,b,c,d,e,f,g,h) def load_sol(self, stream): X = self.read(stream, int) self.read(stream, None) return Sol(X=X)