ftp.nice.ch/pub/next/unix/tools/juggle.1.0.N.bs.tar.gz#/juggle.man

This is juggle.man in view mode; [Download] [Up]

.TH JUGGLE 6 
.fi
.SH NAME
juggle
\-
animated juggling patterns
.SH SYNTAX
.na
.nf
juggle [-p pattern][-r period][-n name][-s step][-hv]
.SH OPTIONS
.na
.nf
.fi
.TP 8
.B "-p pattern"
Juggle the specified pattern.
.TP
.B "-r period"
Juggle a random pattern of the specified period.
.TP
.B "-n name"
Give a name to the juggling pattern.
.TP
.B "-s step"
Specify the juggling timestep (between 0 and 1).
.TP
.B "-h"
Hold throws of height 2, instead of throwing them.
.TP
.B "-v"
Print the program version, and exit.
.SH DESCRIPTION
.fi
.B juggle
displays an animated juggling pattern.  The exact details of the
display depend on which version of the program you are running.
With the no-frills
.MS curses 3
version you get simple ASCII juggling balls.  Other X-based
versions may provide niftier features.

.B juggle
is based on an article in a March 95 issue of \fBNew Scientist\fP
by Ian Stewart.  It explains the theory better than this man page
ever will, so it's worth a look.
.SH JUGGLING PATTERNS
.na
.nf
.fi
One problem is how to visualize a juggling pattern, and how to
represent it compactly.  An even bigger problem is how to do it
using crude ASCII graphics.

This is one of the simplest juggling patterns, the 3-ball
cascade:

.EX 5
.ft C
\&  _  _  _  _  _  _  _  _
\&\\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/
\&/\\ /\\ /\\ /\\ /\\ /\\ /\\ /\\ /\\
\&  X  X  X  X  X  X  X  X
\&\\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/

-4 -3 -2 -1  0  1  2  3  4
.ft P
.EE

Time is represented along the bottom, with an arbitrary time
zero.  The pattern is assumed to extend forever, both past and
future.  Each integer time represents the time a ball is thrown.
The way to read this diagram is to trace the path of each ball
diagonally up and down again to the next time it is thrown.  The
compact way of representing this is to record the time
differences between successive throws.  In this example, a throw
from -4 goes to -1, a throw from -3 goes to 0, and so on, so the
differences are 333333...  This is abbreviated further by just
recording the non-repeating part, which boils this pattern down
to just `3'.

As another (slightly more complicated) example, this is the
3-ball shower:

.EX 5
.ft C
\&     _     _     _     _
\&\\   / \\   / \\   / \\   / \\
\& \\ /   \\ /   \\ /   \\ /   \\
\&  X     X     X     X
\& / \\   / \\   / \\   / \\   /
\&/   \\ /   \\ /   \\ /   \\ /
\&  _  X  _  X  _  X  _  X
\&\\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\

-4 -3 -2 -1  0  1  2  3  4
.ft P
.EE

A throw from -4 goes to -3, a throw from -3 goes to 2, a throw
from -2 goes to -1, and so on.  Successive time differences have
the sequence 151515..., so reducing this to its non-repeating
part gives a pattern of `15'.

These juggling patterns are in what is called `site-swap'
notation.  This is how you specify patterns to
.B juggle.
You can unpack site-swap notation to find how the balls get
thrown by drawing a diagram like the ones shown above.  Time
differences in a pattern correspond to the heights balls get
thrown at (for more time, you need to throw the ball higher).
Throw height 0 corresponds to an empty hand.  Throw height 1
corresponds to a rapid shower pass from one hand to the other
that is thrown again immediately.  Throw height 2 ought to mean a
low throw from one hand to itself, but in practice the ball is
usually held momentarily.  By default,
.B juggle
throws balls of height 2 anyway, but if you use the -h (hold)
option the ball will be held instead.

You can work out the number of balls required to juggle a pattern
by simply taking the average of the numbers in the site-swap
sequence.  For instance, the exotic (but jugglable) pattern
566151 requires (5+6+6+1+5+1)/6 or four balls, as can be checked
by drawing the diagram.

Not all sequences of numbers correspond to jugglable patterns.
Some sequences lead to situations where you have to hold or throw
two balls at once.  There is a test (which
.B juggle
applies before trying to juggle a pattern) which goes like this.
Consider 566151 again.  This contains six numbers, so the period
is 6.  Add to these the values 0, 1, 2, 3, 4, 5 in turn to get
578496.  If any of these is 6 (the period) or greater, subtract
6, getting 512430.  If this is a permutation of 012345 then the
pattern is theoretically jugglable.  On the other hand, applying
the same process to the superficially similar sequence 561651
leads to 513330.  This is not a permutation of 012345, so the
pattern can't be juggled (as can be verified by trying to draw
the diagram).

You can also work this rule backwards to create patterns (as
.B juggle
does when picking random patterns).  For a period 5 pattern,
simply choose a random permutation of 01234, such as 43021.  Now
subtract the numbers 0, 1, 2, 3, 4 to get 4, 2, -2, -1, -3.
Finally add the period (5 in this case) to anything negative, and
you get 42342.  You have a new juggling pattern which requires
(4+2+3+4+2)/5 = 3 balls.
.SH RESTRICTIONS
.na
.nf
.fi
Not all juggling patterns are accessible using random patterns.

Most of the patterns displayed are amazingly difficult to juggle
(for \fIme\fP, anyway).
.SH BUGS
.fi
.B juggle
never drops a ball (makes you sick, doesn't it?).
.SH SEE ALSO
.fi
.fi
"Juggling By Numbers", \fBNew Scientist\fP no. 1969
(18 March 1995).
.SH AUTHOR
.na
.nf
Glenn Hutchings (zondo@hunting2.demon.co.uk)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.