From 4bec4883792f86cd835936113a9d39bebcf0344f Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 15 May 2022 02:32:08 -0700 Subject: web: implement difficulty abstraction for stdev --- web/static/index.html | 6 +++--- web/static/style.css | 4 ++++ web/static/sw.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'web/static') diff --git a/web/static/index.html b/web/static/index.html index 2ed654b..472247d 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -17,7 +17,7 @@
dartboat™
-
+
@@ -75,8 +75,8 @@

dartboat

dartboat uses an internal representation of a specification dartboard. Darts are thrown following a normal distribution, with the resultant coordinates used to calculate the segments in which they land. The idea is that this provides a more realistic opponent than picking points at random.

Settings

-

(delay) — milliseconds it takes the computer to throw each dart.

-

(stdev) — the standard deviation of the computer's throws in millimetres. A value of 24 translates to a three-dart average of roughly 35. A value of 13 would be a 65 average, and a value of 8 a 95 average.

+

(delay: 0-9999) — milliseconds it takes the computer to throw each dart.

+

(difficulty: 0-99) — precision of the computer's throws. Starting with a three-dart average of 10 points at difficulty 0, every difficulty increase of 8 corresponds to an average points increase of 10, e.g. difficulty 32 would be a 50-point average. (The rate of increase quickly increases upon reaching an average of 120 points.)

Interface

To avoid destructive actions being a misclick away, certain actions require two presses—one to activate the button and another to trigger it.

The controls are designed to be keyboard-friendly. The keys should be fairly intuitive for the most part.

diff --git a/web/static/style.css b/web/static/style.css index 852cffd..f0f4b2f 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -144,6 +144,10 @@ body { border: 0; } +#titlebar input#difficulty { + width: 2ch; +} + #titlebar div.button { background-color: #3d2466; font-weight: 700; diff --git a/web/static/sw.js b/web/static/sw.js index bf1d818..7576286 100644 --- a/web/static/sw.js +++ b/web/static/sw.js @@ -1,5 +1,5 @@ const CACHE_PREFIX = 'dartboat-' -const CACHE_VERSION = '5'; +const CACHE_VERSION = '6'; const CACHE_NAME = `${CACHE_PREFIX}${CACHE_VERSION}`; const CACHE_FILES = [ -- cgit v1.2.3-70-g09d2