RosettaCodeData/Task/First-class-functions/Deja-Vu/first-class-functions.djv

19 lines
274 B
Plaintext

negate:
- 0
set :A [ @++ $ @negate @-- ]
set :B [ @-- $ @++ @negate ]
test n:
for i range 0 -- len A:
if /= n call compose @B! i @A! i n:
return false
true
test to-num !prompt "Enter a number: "
if:
!print "f^-1(f(x)) = x"
else:
!print "Something went wrong."