RosettaCodeData/Task/Permutations/FutureBasic/permutations-1.basic

18 lines
284 B
Plaintext

void local fn perm( k as Short)
static Short w( 4 ), i = -1
Short j
i ++ : w( k ) = i
if i = 4
for j = 1 to 4 : print w( j ),
next : print
else
for j = 1 to 4 : if w( j ) = 0 then fn perm( j )
next
end if
i -- : w( k ) = 0
end fn
fn perm(0)
handleevents