mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
32 lines
572 B
Go
32 lines
572 B
Go
// -*- go -*-
|
|
|
|
package main
|
|
|
|
type Size = uint32
|
|
|
|
type Applicant struct {
|
|
male bool
|
|
age Size
|
|
income Size
|
|
}
|
|
|
|
type Bank struct {
|
|
maxAge Size
|
|
femaleIncome Size
|
|
maleIncome Size
|
|
}
|
|
|
|
func main(applicant Applicant, bank Bank) bool {
|
|
// Bank sets the maximum age limit.
|
|
if applicant.age > bank.maxAge {
|
|
return false
|
|
}
|
|
if applicant.male {
|
|
// Credit criteria for males.
|
|
return applicant.age >= 21 && applicant.income >= bank.maleIncome
|
|
} else {
|
|
// Credit criteria for females.
|
|
return applicant.age >= 18 && applicant.income >= bank.femaleIncome
|
|
}
|
|
}
|