http://qs1969.pair.com?node_id=11139234


in reply to table of values

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11139200 use warnings; use List::Util qw( none ); $| = 1; my @strings; while( @strings < 10 ) { my $try = join '', map +('A' .. 'Z')[rand 26], 1 .. 5; if( none { ($try ^ $_) =~ tr/\0//c < 3 } @strings ) { push @strings, $try; print "$try "; } } print "\n";

Sample Output

OJLGF RESJW YKHXZ CGINN RMVRS NBVJA PKZFG DHBNR JMXML QFAUY

Replies are listed 'Best First'.
Re^2: 10 x 10 table of values
by dnamonk (Acolyte) on Nov 29, 2021 at 20:44 UTC
    Great solution. Thanks a lot :) One question. Why is the program freezing? The program gets stuck at 30 output if I want to let's say 70-99 instead of just 10.

      What letters are you using? I changed the program to just use five letters only from ACGT (you mentioned biology) and it can't find 100 (it times out). There may not be that many strings that are that mutually different.

      Please show the code you are running that hangs.

        Yes you are right :)