summaryrefslogtreecommitdiff
path: root/tests/bench/shuffle.icn
blob: 01fdb17a71211bf76846d5e6f0708e332a15a382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
############################################################################
#
#	Name:	shuffle.icn
#
#	Title:	Shuffle values
#
#	Author:	Ward Cunningham
#
#	Date:	June 10, 1988
#
############################################################################
#  
#     The procedure shuffle(x) shuffles a string or list. In the case
#  that x is a string, a corresponding string with the characters
#  randomly rearranged is produced. In the case that x is a list,
#  the values in the list are randomly rearranged.
#  
############################################################################

procedure shuffle(x)
   x := string(x)
   every !x :=: ?x
   return x
end