This is the work of a group of Minecraft fans called the Farlanders and it's one of the most inventive maps I've in quite some time. Making use of the new hoppers, storage minecarts and comparators that have been included in the latest snapshots, the basketball automatically assigns team members, tracks the score for you and even launches appropriately-coloured victory fireworks.
The machinery that takes care of this is hidden well out of the way of the players and ticks away beside or underneath the court, so all you need do is play. The whole thing even resets itself when the match is won. It's a marvel of Minecraft design and engineering and is practically a total conversion, a basketball minigame. Click through to see the video explaining exactly how it works.
Before you watch, you I should add that things like hoppers and comparators aren't yet included in the latest official version of Minecraft, but are found in the latest developer snapshots (work-in-progress versions of the game), such as 13w02b, which you can find here on Mojang's site. If you've never installed a developer snapshot before, we have a guide that can help.
If you want to play a few games in this basketball court you can download it here.