Coding Challenge #71 - Wheel of Names
This challenge is to build your own version of Wheel of Names.
Hi this is John with this week’s Coding Challenge.
🙏 Thank you for being one of the 62,469 software developers who have subscribed, I’m honoured to have you as a reader. 🎉
Coding Challenge #71 - Wheel of Names
This challenge is to build your own version of Wheel of Names.
It’s an app, that I presume is inspired by the TV show Wheel of Fortune. In the TV show contestants win prizes for successfully answering question and the Wheel is spun to determine what prize they win.
Wheel of Names is similar, but allows us to create a virtual wheel, putting our own names on it, then virtually spin it to determine a winner. I’ve come across several teams who use it as a fun and informal way to determine which team member will run a ceremony from their process - i.e. their next retrospective.
I jokingly suggested someone could use it to pick which coding challenge to build next, then thought hey, it would make a good challenge itself, so here we are!
If You Enjoy Coding Challenges Here Are Three Ways You Can Help Support It
Refer a friend or colleague to the newsletter. 🙏
Sign up for a paid subscription - think of it as buying me a coffee ☕️ twice a month, with the bonus that you also get 20% off any of my courses.
Buy one of my courses that walk you through a Coding Challenge.
The Challenge - Building Wheel of Names
For this challenge you’ll be building your own Wheel of Names. It could be a desktop, CLI or web based solution. It’ll be most fun for the user if the wheel is visualised and can be seen spinning and slowing down.
Here’s an example wheel of names for several of the past coding challenges:
Step Zero
In this step you decide which programming language and IDE you’re going to use and you get yourself setup with a nice new project.
This would be a great project to try a frontend stack if you’re a backend developer and if you’re a frontend developer perhaps try building a desktop application.
Step 1
In this step your goal is to allow the user to enter a list of names. For now it can be a simple text box with one name per line.
Step 2
In this step your goal is to allow the names to be shuffled and sorted. I’d suggest adding a button for each option.
Step 3
In this step your goal is to draw the wheel with the names on. Each name should get an equal segment from the circle. This will change as you add more names.
The text for the name should fit in the segment and each segment should be a different colour to it’s two neighbouring segments.
Step 4
In this step your goal is to allow the user to spin the wheel, animate it spinning and slowing down. Then display a winner, much like below:
Step 5
In this step your goal is to support an advanced mode where the user can specify the colour and the size of each segment.
Going Further
Here are some ideas on how to take this further:
Deploy it!
Allow users to save wheels and share / return to them.
Provide the wheel of names via a Discord bot - see the build your own Discord bot coding challenge to learn more about building Discord bots.
2 Other Ways I Can Help You:
I write another FREE newsletter Developing Skills that helps you level up the other skills you need to be a great software developer.
I have some courses available:
Build Your Own Redis Server (Python Edition) which guides you through solving the Redis Coding Challenge in Python.
Build Your Own Shell (Go Edition) which guides you through solving the Shell Coding Challenge in Go.
Share Your Solutions!
If you think your solution is an example other developers can learn from please share it, put it on GitHub, GitLab or elsewhere. Then let me know via Twitter or LinkedIn or just post about it there and tag me.
Request for Feedback
I’m writing these challenges to help you develop your skills as a software engineer based on how I’ve approached my own personal learning and development. What works for me, might not be the best way for you - so if you have suggestions for how I can make these challenges more useful to you and others, please get in touch and let me know. All feedback greatly appreciated.
You can reach me on Twitter, LinkedIn or through SubStack
Thanks and happy coding!
John
I recently did it in LinkedIn just for fun