13 lines
220 B
Text
13 lines
220 B
Text
#Procedure
|
|
exp = { base, exp |
|
|
1.to(exp).reduce 1, { m, n | m = m * base }
|
|
}
|
|
|
|
#Numbers are weird
|
|
1.parent.^ = { rhs |
|
|
num = my
|
|
1.to(rhs).reduce 1 { m, n | m = m * num }
|
|
}
|
|
|
|
p exp 2 5 #Prints 32
|
|
p 2 ^ 5 #Prints 32
|