Generate puzzle function implemented

pair programming