Function square_set_to_array is now complete!!! Porting the De Bruijn algorithm proved to be very difficult.
A more naive solution has been used.