Flip a weighted coin

Thanks, this might work, but actually what I was looking to do was flip multiple coints with different weights, are there modifications of this that would work? I suppose that would need a new distribution every time so it might not be optimal.