Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This file gives a list of example rules that the players can submit.
- accounts :: V [(PlayerNumber, Int)]
- createBankAccounts :: Rule
- depositAPI :: APICall (PlayerNumber, Int) Bool
- withdrawAPI :: APICall (PlayerNumber, Int) Bool
- balanceAPI :: APICall PlayerNumber (Maybe Int)
- bankServices :: Nomex ()
- deposit :: (PlayerNumber, Int) -> Nomex Bool
- withdraw :: (PlayerNumber, Int) -> Nomex Bool
- getBalance :: PlayerNumber -> Nomex (Maybe Int)
- displayBankAccounts :: Rule
- winXEcuPerDay :: Int -> Rule
- winXEcuOnRuleAccepted :: Int -> Rule
- moneyTransfer :: Rule
- transfer :: PlayerNumber -> (PlayerNumber, Int) -> Nomex ()
Documentation
createBankAccounts :: Rule Source #
Create a bank account for each players
depositAPI :: APICall (PlayerNumber, Int) Bool Source #
Declare an API to deposit money for a player The return value shows if the transaction was successful.
withdrawAPI :: APICall (PlayerNumber, Int) Bool Source #
Declare an API to withdraw money for a player. The return value shows if the transaction was successful.
balanceAPI :: APICall PlayerNumber (Maybe Int) Source #
Declare an API to get the balance of a player.
bankServices :: Nomex () Source #
getBalance :: PlayerNumber -> Nomex (Maybe Int) Source #
displayBankAccounts :: Rule Source #
Permanently display the bank accounts
winXEcuPerDay :: Int -> Rule Source #
each player wins X Ecu each day you can also try with "minutly" or "monthly" instead of "daily" and everything in the "time-recurrence" package
winXEcuOnRuleAccepted :: Int -> Rule Source #
a player wins X Ecu if a rule proposed is accepted
moneyTransfer :: Rule Source #
a player can transfer money to another player
transfer :: PlayerNumber -> (PlayerNumber, Int) -> Nomex () Source #
helper function to transfer money from first player to second player