search and random board generation