FUNCTION: BnGenCode - generate one code
 
CALLING SEQUENCE:
-   BnGenCode(n, typecode)
-   BnGenCode(code, typecode)
-   BN[BnGenCode](n, typecode)
-   BN[BnGenCode](code, typecode)
-  
     
PARAMETERS:
- n        =  any positive integer
- code     =  any list denoting a code
- typecode =  'first', 'previous', 'next', 'last'
 
   
SYNOPSIS:
-  The BnGenCode function generates one element of  a hyperoctahedral group
  in lexicographic order, according to the parameter typecode.
 
 
-  BnGenCode(n, 'first') returns the first code of B(n).
 
 
-  BnGenCode(n, 'last') returns the last code of B(n).
 
 
-  BnGenCode(code, 'previous') gives  the  previous code according  to  the
  lexicographic order. It returns the NULL value when code is already  the
  first code [0, 0, 0, ...].
 
 
-  BnGenCode(code, 'next')  gives   the   next   code    according  to  the
  lexicographic order. It returns the NULL value when code is already  the
  last code [1, 3, 5, ...].
 
 
-  Whenever there is a  conflict between  the  function  name BnGenCode and
  another   name   used   in   the   same   session, use   the  long  form
  BN['BnGenCode'].
 
 
EXAMPLES:
> with(BN):
> BnGenCode([1, 2, 5, 7], 'next');
 
                                [1, 3, 0, 0]
 
> BnGenCode([1, 3, 0, 0], 'previous');
 
                                [1, 2, 5, 7]
 
SEE ALSO: