@@ -483,6 +483,23 @@ def generation(self,
483483 log += state
484484 self ._print (log , state , data = data , cached = cached )
485485
486+ def terry_generation (self ,
487+ solution : str ,
488+ seed : int ,
489+ state : str ,
490+ data : str = None ,
491+ cached : bool = False ):
492+ if self .json :
493+ self ._json ("generation" , state , {
494+ "solution" : solution ,
495+ "seed" : seed
496+ }, data , cached )
497+ else :
498+ log = ("Generation of input for %s with seed %d " %
499+ (solution , seed )).ljust (50 )
500+ log += state
501+ self ._print (log , state , data = data , cached = cached )
502+
486503 def validation (self ,
487504 testcase : int ,
488505 subtask : int ,
@@ -500,6 +517,19 @@ def validation(self,
500517 log += state
501518 self ._print (log , state , data = data , cached = cached )
502519
520+ def terry_validation (self ,
521+ solution : str ,
522+ state : str ,
523+ data : str = None ,
524+ cached : bool = False ):
525+ if self .json :
526+ self ._json ("validation" , state , {"solution" : solution }, data ,
527+ cached )
528+ else :
529+ log = ("Validation of input for %s " % solution ).ljust (50 )
530+ log += state
531+ self ._print (log , state , data = data , cached = cached )
532+
503533 def solving (self ,
504534 testcase : int ,
505535 subtask : int ,
@@ -545,6 +575,18 @@ def evaluate(self,
545575 log = log .ljust (50 ) + state
546576 self ._print (log , state , data = data , cached = cached )
547577
578+ def terry_evaluate (self ,
579+ solution : str ,
580+ state : str ,
581+ data : str = None ,
582+ cached : bool = False ):
583+ if self .json :
584+ self ._json ("evaluate" , state , {"solution" : solution }, data , cached )
585+ else :
586+ log = ("Evaluate solution %s " % solution ).ljust (50 )
587+ log += state
588+ self ._print (log , state , data = data , cached = cached )
589+
548590 def checking (self ,
549591 solution : str ,
550592 testcase : int ,
@@ -564,6 +606,55 @@ def checking(self,
564606 log += state
565607 self ._print (log , state , data = data , cached = cached )
566608
609+ def terry_checking (self ,
610+ solution : str ,
611+ state : str ,
612+ data : str = None ,
613+ cached : bool = False ):
614+ if self .json :
615+ self ._json ("checking" , state , {"solution" : solution }, data , cached )
616+ else :
617+ log = ("Checking solution %s " % solution ).ljust (50 )
618+ log += state
619+ self ._print (log , state , data = data , cached = cached )
620+
621+ def testcase_outcome (self , solution : str , testcase : int , subtask : int ,
622+ info : "TestcaseSolutionInfo" ):
623+ if self .json :
624+ self ._json (
625+ "testcase-outcome" , "success" , {
626+ "solution" : solution ,
627+ "testcase" : testcase ,
628+ "subtask" : subtask ,
629+ "status" : str (info .status ).split ("." )[- 1 ],
630+ "score" : info .score ,
631+ "message" : info .message
632+ })
633+ else :
634+ log = "Outcome of solution %s: score=%f message=%s" % (
635+ solution , info .score , info .message )
636+ self ._print (log , "SUCCESS" )
637+
638+ def terry_solution_outcome (self , solution : str , info : "SolutionInfo" ):
639+ if self .json :
640+ self ._json (
641+ "solution-outcome" , "success" , {
642+ "solution" :
643+ solution ,
644+ "status" :
645+ str (info .status ).split ("." )[- 1 ],
646+ "score" :
647+ info .score ,
648+ "message" :
649+ info .message ,
650+ "testcases" :
651+ [str (s ).split ("." )[- 1 ] for s in info .testcases_status ]
652+ })
653+ else :
654+ log = "Outcome of solution %s: score=%f message=%s" % (
655+ solution , info .score , info .message )
656+ self ._print (log , "SUCCESS" )
657+
567658 def warning (self , message : str ):
568659 if self .json :
569660 self ._json ("warning" , "warning" , {"message" : message })
0 commit comments