1 |
greg |
1.5 |
.\" RCSid "$Id: cnt.1,v 1.4 2019/07/20 00:57:43 greg Exp $" |
2 |
greg |
1.1 |
.TH CNT 1 11/15/93 RADIANCE |
3 |
|
|
.SH NAME |
4 |
|
|
cnt - index counter |
5 |
|
|
.SH SYNOPSIS |
6 |
|
|
.B cnt |
7 |
greg |
1.5 |
[ |
8 |
|
|
.B \-s |
9 |
|
|
] |
10 |
|
|
N1 |
11 |
|
|
[ |
12 |
|
|
N2 .. |
13 |
|
|
] |
14 |
greg |
1.1 |
.SH DESCRIPTION |
15 |
|
|
.I Cnt |
16 |
|
|
counts from 0 to N-1, producing N lines of output. |
17 |
|
|
If multiple arguments are given, |
18 |
|
|
.I cnt |
19 |
|
|
produces a nested array of values where the final counter |
20 |
|
|
rotates fastest through its range. |
21 |
greg |
1.5 |
The |
22 |
|
|
.I \-s |
23 |
|
|
option shuffles the output lines, giving a different random |
24 |
|
|
order on each invocation. |
25 |
greg |
1.1 |
.I Cnt |
26 |
|
|
is most useful in conjunction with |
27 |
|
|
.I rcalc(1) |
28 |
|
|
to produce array values. |
29 |
|
|
.SH EXAMPLE |
30 |
|
|
To create a 3 by 5 array: |
31 |
|
|
.IP "" .2i |
32 |
|
|
cnt 3 5 |
33 |
greg |
1.5 |
.PP |
34 |
|
|
To generate a random shuffle of indices 0 through 51: |
35 |
|
|
.IP "" .2i |
36 |
|
|
cnt -s 52 |
37 |
|
|
.PP |
38 |
|
|
Similar shuffling broken down by suit: |
39 |
|
|
.IP "" .2i |
40 |
|
|
cnt -s 4 13 |
41 |
greg |
1.1 |
.SH AUTHOR |
42 |
|
|
Greg Ward |
43 |
|
|
.SH "SEE ALSO" |
44 |
greg |
1.4 |
neaten(1), rcalc(1), rlam(1), rsplit(1), total(1) |