A Fortran 77 subroutine is provided for computing exact critical values for the Kruskal- Wallis test on k independent groups with equal or unequal samples sizes. The subroutine requires the user to provide sorting and ranking routines and a uniform pseudo-random number generator. The program is available from the author on request.
Headrick, Todd C. "An Algorithm For Generating Exact Critical Values For the Kruskal-Wallis One-Way ANOVA." (Spring 2003).