The D4 is unlocked when 30 Slot Machines are destroyed (via explosion or overloading) by Isaac. The Slot Machine also has a 2% chance to self-destruct after inserting a penny, in which case it drops several random pickups or A Dollar and becomes unusable. If the Slot Machine is caught in an explosion of any kind, it will be destroyed, yielding various rewards (see below). Slot Machines appear naturally in Arcades, Secret Rooms, and other room layouts, and can be summoned using the X - Wheel of Fortune tarot card. The Machine then has a chance to spawn one of its possible rewards.
Walking up to the Slot Machine and bumping into it will consume one penny and spin the slots.