secrets
This commit is contained in:
1 parent
96f2d570b1
commit
f83515caf0
10 files changed
+410
No files matched your search
@@ -0,0 +1,22 @@
|
||||
pub fn secret_add(secret: Int) -> fn(Int) -> Int {
|
||||
fn(n: Int) { n + secret }
|
||||
}
|
||||
|
||||
pub fn secret_subtract(secret: Int) -> fn(Int) -> Int {
|
||||
fn(n: Int) { n - secret }
|
||||
}
|
||||
|
||||
pub fn secret_multiply(secret: Int) -> fn(Int) -> Int {
|
||||
fn(n: Int) { n * secret }
|
||||
}
|
||||
|
||||
pub fn secret_divide(secret: Int) -> fn(Int) -> Int {
|
||||
fn(n: Int) { n / secret }
|
||||
}
|
||||
|
||||
pub fn secret_combine(
|
||||
secret_function1: fn(Int) -> Int,
|
||||
secret_function2: fn(Int) -> Int,
|
||||
) -> fn(Int) -> Int {
|
||||
fn(n: Int) { secret_function2(secret_function1(n)) }
|
||||
}
|
||||
Reference in new issue
Block a user