Skip to content

rottney/dartscore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dartscore - Score a game of darts

dartscore_cricket dartscore_301

Summary

Dartscore is a simple darts scoring web app written in React. It can be used to score a game of Cricket or 301 darts for 2-4 players. It runs on any browser and is written with a mobile-first approach - very handy when the pub is out of chalk!

This project is one of two primary portfolio pieces I created at The Recurse Center in Brooklyn during the Fall of 2024. The site is hosted using Vercel and can be accessed at dartscore.vercel.app.

Features

Universal

  • 2, 3, or 4 players
  • Undo last step - reverts game to the previous state, in case a turn was incorrectly entered

Cricket mode

  • Point accumulation: in 2-player mode, a player accumulates points when they hit a number they have closed and their opponent hasn't. The first player to close each number (15 - 20 and Bull) and reach a point score greater than or equal to their opponent wins.
  • Cutthroat points: in 3- or 4-player mode, the point accumulation is reversed; after a player has closed a number, each subsequent hit on that number gives points to the opponents who have not closed that number. The first player to close 15 - 20 and Bull with the lowest (or equal to the lowest) score wins.

301 mode

  • Point validation: as the per-round points are entered into a text box, the application validates that the score is valid for a standard 3-dart round. For example, negative values, values greater than 180, and non-integer values are invalid. The application provides a specific error message when the score is out of bounds.
  • Busts: If a player busts, i.e. goes below 0 on their final score, the score for that round is marked, but the total score remains unchanged, and the busted score is rendered in red.

Future enhancement (in-progress)

This application works great on a large shared screen (like a laptop), but the user experience is poor on mobile because whoever is keeping score must pass their phone to everyone playing, or mark everyone's score themself. To improve this experience, I am implementing a backend using Flask so that each game is assigned a unique session ID that can be shared between everyone playing that game (the ID will be appended to the application's root URL). The communication between the clients and server will be handled using WebSocket so that one player's changes will be rendered across all players' devices.

Feedback?

If you notice any issues while using the app, please feel free to open a bug report using the Issues tab and I will get it fixed as quickly as possible.

Contributions welcome! Please reach out at [email protected] if interested and I will be happy to get you onboarded. 🙂

About

score a game of darts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published