Hacker News new | ask | show | jobs
Show HN: Basketball Play Designer (basketballdesigner.com)
6 points by kmcgraw 1007 days ago
In a company hackathon this weekend, I thought it would be fun to build a basketball play designer. Essentially, you enter some information about the type of play you want, and it generates a play following these requirements. I was imagining it might be useful for stuff like: 1. Designing personalized plays for first-time coaches: "Give me a play that gets my shooting guard an open three-pointer. My shooting guard shoots the best from the right wing, and my point guard has a weak left hand. My center sets great screens, so have my center set an off-ball screen for my shooting guard." 2. Brainstorming novel plays for long-time coaches: "Generate a novel play out of the UCLA set." It is loaded in with an example play, so make sure to hit the buttons to generate new plays with the entered information. The animation generation is based on the play-by-play and is a bit finicky, so you can try to generate new play-by-plays/animations if the first ones don't work well. It's still a bit rough around the edges, but I'd love to know what people think!
2 comments

If anyone knows of any basketball forums where I should show this, please let me know!
holy shit. How does this work? Do you just have a big list?
Haha, it queries chatGPT. It required a good amount of prompt engineering to get reasonable results, and there's definitely plenty of room for improvement. Glad you liked it!
How does the play animation work? Do you get some sort of json blob output? How do you make sure it fits your schema?
I get it in the form of a Python array that I parse. I try to prompt-engineer to make sure that it is returned in the expected form, but you could probably try to break it with specific inputs.