A Randomizer based on the rotation of an Item you can use this Command to generate Random Numbers (default: 0-5). You can even add more Commandblocks to it for more Numbers.
What the Machine looks like
Known Bugs : Items thrown near the Machine will be removed (radius only 5 Blocks)
Hope you like it =)