Reveal cards from the top of your library until you reveal an artifact card. Put that card onto the battlefield and the rest on the bottom of your library in a random order. Madcap Experiment deals damage to you equal to the number of cards revealed this way.
(20/09/2016)
If you don't reveal an artifact card, you'll randomize your library and be dealt damage equal to the number of cards in your library.
(20/09/2016)
Once Madcap Experiment begins resolving, no player may take any actions other than those specified by Madcap Experiment until it's done resolving.
(20/09/2016)
The number of cards revealed this way includes the artifact card you put onto the battlefield.
(20/09/2016)
Any abilities that trigger as the artifact enters the battlefield aren't put onto the stack until Madcap Experiment is done resolving.