← back to blog

Swift coin flip

2025-01-09

Swift

Of course there is a random() class method on Bool... Duh!?

print(Bool.random() ? "heads" : "tails")