defmoduleCashMachinedo#🎵 `goto` a CashMachinedefchange(money)do#🎵 to get a ticket homeexchange(money,%{})#🎵 the message on the screenend#🎵 says "don't make plans, y'all broke"defpexchange(0,coins),do:coins#🎵 no, no, this can't be rightdefpexchange(coin,coins)whencoin>=25do#🎵 I know that times is tightquarters=div(coin,25)#🎵 I've only just been paidcoin=rem(coin,25)#🎵 three weeks, five days, do that seemexchange(coin,put_in(coins[25],quarters))#🎵 right? no.enddefpexchange(coin,coins)whencoin>=10do#🎵 I scratch a livin', it ain't easydimes=div(coin,10)#🎵 you know it's a dragcoin=rem(coin,10)#🎵 I'm always payin', never makin'exchange(coin,put_in(coins[10],dimes))#🎵 but you can't look backenddefpexchange(coin,coins)whencoin>=5do#🎵 I wonder if I'll ever get tonickels=div(coin,5)#🎵 where I want to becoin=rem(coin,5)#🎵 better believe it,exchange(coin,put_in(coins[5],nickels))#🎵 I'm workin' for the CashMachineenddefpexchange(coin,coins)whencoin>=1do# lyrics from "Cash Machine"exchange(0,put_in(coins[1],coin))# by Hard-Fiendend
Some people may say "are the comments really necessary?"
I say to them, "Is capitalism?"
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
that guard clause
Some people may say "are the comments really necessary?"
I say to them, "Is capitalism?"