An up–down permutation P=(p1,p2,…,pn) is a permutation of the integers 1 to n which satisfies constraints specified by a sequence C=(c1,c2,…,cn−1) of Uʹs and Dʹs of length n−1. If ci is U then pi
pi. A loopless algorithm is developed for generating all the up–down permutations satisfying any sequence C. Ranking and unranking algorithms are discussed.