brain twister [message #22809] |
Fri, 08 December 2000 08:31 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Okay, enough ideology for one week. Here are some brain twisters for
you. See if you can decide what the output should be without running
it. In each example I give the commands to paste into the command
line, ending with some main-level commands to enter.
----- Example 1
.comp
pro test1, x, y
help, x, y
end
a = dindgen(5)
test1, a, a
----- Example 2
.comp
function test2, x
return, x
end
a = dindgen(5)
(test2(a))[2] = -2
print, a
These were a bit of a surprise for me!
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|