From 8f06c6c38197f7654d4f1fde386242d09eefff77 Mon Sep 17 00:00:00 2001 From: Leopere Date: Sun, 8 Feb 2026 16:56:21 -0500 Subject: [PATCH] Show Sum and Possible on dice rolls Dice output now always shows "Sum: X of Possible: Y" where Y is sides * count, on both the main page and standalone /tools page. Co-authored-by: Cursor --- src/index.html | 2 +- src/tools.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index 6597fe4..3f1a118 100644 --- a/src/index.html +++ b/src/index.html @@ -698,7 +698,7 @@ const r = await fetch(origin + '/dice?d=' + d + '&count=' + c); if (!r.ok) throw new Error(await r.text()); const j = await r.json(); - toolsOutput.textContent = 'Rolls: ' + j.rolls.join(', ') + (j.count > 1 ? ' Sum: ' + j.sum : ''); + toolsOutput.textContent = 'Rolls: ' + j.rolls.join(', ') + ' Sum: ' + j.sum + ' of Possible: ' + (j.sides * j.count); } catch (e) { toolsOutput.className = 'output error'; toolsOutput.textContent = 'Error: ' + e.message; } setToolsLoading(false); }); diff --git a/src/tools.html b/src/tools.html index e129053..4629527 100644 --- a/src/tools.html +++ b/src/tools.html @@ -283,7 +283,7 @@ if (!r.ok) throw new Error(await r.text()); const j = await r.json(); outDice.className = 'output copyable'; - outDice.textContent = 'Rolls: ' + j.rolls.join(', ') + (j.count > 1 ? ' Sum: ' + j.sum : ''); + outDice.textContent = 'Rolls: ' + j.rolls.join(', ') + ' Sum: ' + j.sum + ' of Possible: ' + (j.sides * j.count); } catch (e) { outDice.className = 'output copyable error'; outDice.textContent = 'Error: ' + e.message; } disableAll(false); });