What is a good ways to make random strings of length n
, where the strings consist of only 0's and 1's?
- (obviously strings will repeat after some point, but assume we have enough length so we don't hit this ).
Would using math.random()
and round
and then just joining the generating numbers be good?
Maybe there is a way to generate all $n$ digits at once instead of in a loop as in above?
Aucun commentaire:
Enregistrer un commentaire