Gateway Men's Dart league

GMDL – stats and info

statstest

GMDL 1001 Prototype v1 body{font-family:Arial,sans-serif;margin:20px;max-width:1400px} input,button{padding:8px} .table-wrap{overflow-x:auto} table{border-collapse:collapse;width:100%} th,td{border:1px solid #ccc;padding:6px;text-align:center} th{background:#e6e6e6} .high{background:#d8ffd8;font-weight:bold} #currentShooter{font-size:24px;font-weight:bold;color:#0a4}

GMDL 1001 Prototype v1

Single-team validation prototype. No saving. No exports.

Player 1: Player 2: Player 3: Player 4:

Digital Scoresheet

Player Totals

let players=[]; let currentPlayer=0; let history=[]; function startGame(){ players=[1,2,3,4].map(i=>({name:document.getElementById(‘player’+i).value||(‘Player ‘+i),scores:[]})); currentPlayer=0;history=[]; document.getElementById(‘gamePanel’).style.display=’block’; updateDisplay(); document.getElementById(‘scoreInput’).focus();} function recordScore(){ const input=document.getElementById(‘scoreInput’); const score=parseInt(input.value); if(isNaN(score)) return; history.push({player:currentPlayer}); players[currentPlayer].scores.push(score); currentPlayer=(currentPlayer+1)%players.length; input.value=”;updateDisplay();input.focus();} function undoLast(){ if(history.length===0) return; const last=history.pop(); players[last.player].scores.pop(); currentPlayer=last.player; updateDisplay();} function resetGame(){ if(!confirm(‘Reset current game?’)) return; players=[];history=[];currentPlayer=0; document.getElementById(‘gamePanel’).style.display=’none’; document.getElementById(‘scoreSheet’).innerHTML=”; document.getElementById(‘playerTotals’).innerHTML=”;} function updateDisplay(){ const shooter=players[currentPlayer]; document.getElementById(‘currentShooter’).textContent=shooter.name; document.getElementById(‘currentRound’).textContent=’Throw #’+(shooter.scores.length+1); buildScoresheet();buildTotals();} function buildScoresheet(){ let html=’‘; for(let i=1;i<=8;i++){html+='‘;} html+=’‘; players.forEach(p=>{let run=0;html+=’‘;for(let i=0;i=95?’ class=”high”‘:”;html+=’‘;}else{html+=’‘;}}html+=’‘;}); html+=’
PlayerS’+i+’T’+i+’
‘+p.name+’‘+s+’‘+run+’
‘;document.getElementById(‘scoreSheet’).innerHTML=html;} function buildTotals(){ let html=’‘; players.forEach(p=>{let pts=p.scores.reduce((a,b)=>a+b,0);let shots=p.scores.length*3;let avg=shots?(pts/shots).toFixed(2):’0.00′;html+=’‘;}); html+=’
PlayerShotsPointsAverage
‘+p.name+’‘+shots+’‘+pts+’‘+avg+’
‘;document.getElementById(‘playerTotals’).innerHTML=html;} document.addEventListener(‘keydown’,e=>{if(e.key===’Enter’&&document.activeElement===document.getElementById(‘scoreInput’))recordScore();});