Split
Divide an amount between alice and bob, the remainder to alice.
- Language
- Python
- Bytecode
- 290bytes
- Cards
- 33
- Units on the Weft VM
- 38 404CU
- Runs
- Inline, in one transaction
amount = 10_000_001
people = [accounts["alice"], accounts["bob"]]
share = amount // len(people)
rest = amount - share * len(people)
for i, who in enumerate(people):
pay = share + (rest if i == 0 else 0)
transfer(who, pay)
print("paid", pay, "to", who[0:6])
return share