Week 2 - Weight Conversions
Thanks for subscribing, and welcome to the second issue of the revamped All Tests Pass, a weekly programming debugging puzzle newsletter. I’m your puzzlemaster, Brandon Morrison, and I’m really happy that you’ve decided to play along.
Last week's puzzle: Bowling for Errors
Last issue we implemented BowlingScoreTracker
, a bowling score-keeping class. This challenge focused on implementing a class that tracked the current score and frame for a bowling game, based on a steady stream of scores.
Because of the special cases with strikes and spares, scoring is more complicated than just totaling up the individual scores.
Thanks to everyone who participated! Here's the list of everyone who played along with the previous coding challenge.
Implementations
- Author Implementation: https://github.com/fillerwriter/alltestspass-week1/tree/author-solution
- Brian Smith: https://github.com/LuosRestil/alltestspass-week1/
This week's puzzle: Weight Conversions
This week, we're going to start on a multi-week puzzle that we'll build on for next week. For this week, we're going to start with building out a function that can convert units of weight.
In following weeks, we'll build out our conversion function to handle other units of measure such as distance and temperature, and to handle a variety of user inputs and error cases.
The rules
- Every Wednesday I'll send out a link to a short coding challenge. Sometimes your challenge will be to debug a pre-built function. Other times you'll need to flesh out a function or a method with a predefined specification. Sometimes we might just laugh at WTF JS moments. Regardless of the specifics, the puzzles should take roughly 30 minutes or less to solve.
- If you decide to play along, take the code from that week's newsletter, and fork it. Your code can live anywhere you feel comfortable. Feel free to use CodeSandbox, GitHub, JSBins, or some other external delivery system. Make your modifications, and respond back to
brandon at brandonmorrison dot com
. Responses should arrive no later than the following Monday at midnight Eastern. Please don't reply back with your code as an email attachment — I will not read it, no matter how nice the code is inside. - When I send out a new puzzle (on Wednesdays!), I'll post a solution to the previous week's puzzle. I'll also give shoutouts to those who responded with a correct answer. Privacy is important to me, so I'll only name you in the way that you identify yourself via your public GitHub/JSBin/CodeSandbox account, unless specifically asked to do otherwise. I won't share your email address.
- AI/Code Generation: While you're free to use any development tools to create your response, including generative AI coding tools, please consider not using them to solve the puzzles for you. The whole point of these puzzles is to enjoy solving the problem, not to get the answer with as little effort as possible.