I have a list of attributes, say it's middle sized.
After that, I have a bunch of subpatterns of this attributes that are coherent both internally and to concatenate to another subpatterns.
How could I structure this both teorethically and practically?
Hi there!
I have a list of attributes, say it's middle sized.
After that, I have a bunch of subpatterns of this attributes that are coherent both internally and to concatenate to another subpatterns.
How could I structure this both teorethically and practically?
Thanks in advance, as usual.
--
http://gamo.sdf-eu.org/
perl -E 'say "Error: Total mess"'
gamo <[email protected]> writes:
I have a list of attributes, say it's middle sized.
After that, I have a bunch of subpatterns of this attributes that are
coherent both internally and to concatenate to another subpatterns.
How could I structure this both teorethically and practically?
I, for one, don't know what you are asking. I think an example would
help you get better answers.
El 19/4/22 a las 16:24, Ben escribi�:
gamo <[email protected]> writes:
I have a list of attributes, say it's middle sized.
After that, I have a bunch of subpatterns of this attributes that are
coherent both internally and to concatenate to another subpatterns.
How could I structure this both teorethically and practically?
I, for one, don't know what you are asking. I think an example would
help you get better answers.
#!/usr/bin/perl -w
use 5.032;
my @m = 'a' .. 'f';
my @pars = qw ( ac ce bf db ee );
my $l = 7; # a squared
my $n = 4 * 4; # size
my $c =0;
my $pick;
my @square;
do {
$pick = @m[int rand(scalar @m)];
if (@square == 0 || @square != $l-1 || @square != 2*$l-1 || @square != 3*$l-1){
push @square, $pick;
$c++;
}else{
for (@pars){
if ($square[$c-1].$pick != $_){
push @square, $pick;
$c++;
last;
}
}
}
}until ($c == $l);
exit 2;
I, for one, don't know what you are asking. I think an example would
help you get better answers.
#!/usr/bin/perl -wNo used.
use 5.032;
my @m = 'a' .. 'f';
my @pars = qw ( ac ce bf db ee );
my $l = 7; # a squared
my $n = 4 * 4; # size
my $c =0;I'd put my $pick = @m[int rand(scalar @m)]; here.
my $pick;
my @square;
do {
$pick = @m[int rand(scalar @m)];
if (@square == 0 || @square != $l-1 || @square != 2*$l-1 || @square != 3*$l-1){
Let's see when this condition would not be true by inverting it using
the rule not(A or B or C) = not A and not B and not C:
@square != 0 && @square == $l-1 && @square == 2*$l-1 && @square == 3*$l-1
This condition (the "else" case) can never be true. Basically your code makes a random list of $l letters from @m.
push @square, $pick;
$c++;
}else{
for (@pars){
if ($square[$c-1].$pick != $_){
push @square, $pick;
$c++;
last;
}
}
}
}until ($c == $l);
exit 2;
I can't relate this code to the words in the question, and I can't work
out what it is you are trying to do. You are making helping you very
hard!
-- Ben.
El 20/4/22 a las 22:17, Ben escribi�:
I, for one, don't know what you are asking. I think an example would
help you get better answers.
I try to write a draft as you requested.
#!/usr/bin/perl -wNo used.
use 5.032;
my @m = 'a' .. 'f';
my @pars = qw ( ac ce bf db ee );
my $l = 7; # a squared
my $n = 4 * 4; # size
my $c =0;I'd put my $pick = @m[int rand(scalar @m)]; here.
my $pick;
my @square;
do {
$pick = @m[int rand(scalar @m)];
if (@square == 0 || @square != $l-1 || @square != 2*$l-1 || @square != 3*$l-1){
Wrong. This is a always match case.
Let's see when this condition would not be true by inverting it using
the rule not(A or B or C) = not A and not B and not C:
@square != 0 && @square == $l-1 && @square == 2*$l-1 && @square == 3*$l-1
Wrong. This is a never match case.
On Tuesday, April 19, 2022 at 5:18:16 AM UTC-5, gamo wrote:
Hi there!
I have a list of attributes, say it's middle sized.
After that, I have a bunch of subpatterns of this attributes that are
coherent both internally and to concatenate to another subpatterns.
How could I structure this both teorethically and practically?
Thanks in advance, as usual.
--
http://gamo.sdf-eu.org/
perl -E 'say "Error: Total mess"'
You're probably looking for Moose or any of the various OO methodologies in Perl.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 09:20:49 |
| Calls: | 12,100 |
| Files: | 15,003 |
| Messages: | 6,517,968 |