From af7d2c741b4ce2a482aeff2ad68c3aa45d3ab51e Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Wed, 16 Dec 2020 01:38:45 -0700 Subject: [PATCH] Give the bulk tester a category for early exit --- js/main.js | 17 +++++++++++++---- style.css | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index bbc075b..92ddf58 100644 --- a/js/main.js +++ b/js/main.js @@ -2175,10 +2175,19 @@ class PackTestDialog extends DialogOverlay { level.advance_tic(input); if (level.state === 'success') { - // TODO warn if exit early? - record_result( - 'success', "Won", - `Exited successfully after ${util.format_duration(level.tic_counter / TICS_PER_SECOND)} (delta ${level.tic_counter - replay.duration})`); + if (level.tic_counter < replay.duration - 10) { + // Early exit is dubious (e.g. this happened sometimes before multiple + // players were implemented correctly) + record_result( + 'early', "Won early", + `Exited early after ${util.format_duration(level.tic_counter / TICS_PER_SECOND)} with ${util.format_duration((replay.duration - level.tic_counter) / TICS_PER_SECOND)} left in the replay`, + true); + } + else { + record_result( + 'success', "Won", + `Exited successfully after ${util.format_duration(level.tic_counter / TICS_PER_SECOND)} (delta ${level.tic_counter - replay.duration})`); + } num_passed += 1; break; } diff --git a/style.css b/style.css index cc99eb8..d4ca4ad 100644 --- a/style.css +++ b/style.css @@ -605,6 +605,9 @@ ol.packtest-colorcoded > li[data-status=running] { ol.packtest-colorcoded > li[data-status=success] { background: hsl(120, 60%, 75%); } +ol.packtest-colorcoded > li[data-status=early] { + background: hsl(75, 60%, 75%); +} ol.packtest-colorcoded > li[data-status=failure] { background: hsl(0, 60%, 60%); }