/* ms[]をかき混ぜる関数 */

#include "deftype.h"
#include "anum.h"

void shuffle(ms,kazu,times)
unchar *ms[];
int kazu,times;
{
unint i,a,b;
unchar *mss;
	srand2(); /* 乱数かき混ぜ　*/
	for (i=0;i<times;i++) { /* times=かき混ぜる回数 */
		a=rand2(kazu);
		b=rand2(kazu);
		/* swap(ms[a],ms[b]):アドレスswap */
		mss=ms[a];
		ms[a]=ms[b];
		ms[b]=mss;
	}
}
