I am trying to program a function depending only on two parameters, let's say n and r, which generates a m x n matrix of natural numbers between 1 and r verifying the following conditions: for two neighboring matrix elements the one on the right must be equal or greater than the one on the left but equal or smaller than n, starting with 1. For n=2 and r=2 for instance, this yields the matrix
{{1,1}, {1,2}, {2,2}}
or for n=3 and r=2, this yields
{{1, 1, 1}, {1, 1, 2}, {1, 2, 2}, {2, 2, 2}}
I tried several hours with Do or Table, but without success. Unfortunately, I am not good enough in programming so any help would highly be appreciated.