Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: 10 x 10 table of values

by tybalt89 (Prior)
on Nov 29, 2021 at 18:19 UTC ( #11139234=note: print w/replies, xml ) Need Help??


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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-05-29 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?