-1
My intention is to decrease the size of the condition, because I thought that it became extensive making it a little difficult to read, and that maybe there could be a better way to do this:
by checking the variables
$l1
and$l2
,$c1
and$c2
joints instead of separate.the 4 variables
$l1
and$l2
,$c1
and$c2
may have any numerical value.I want you to pass on condition only if:
- $L1 and $L2 are greater than or equal to 1 and less than or equal to 8
- and $C1 and $C2 greater than or equal to 97 and less than or equal to 104.
The condition is always the same in all situations:
- $L1 and $L2 between 1 and 8 (including)
- and $C1 and $C2 between 97 and 104 (including)
I have the following condition
<?php
$l1 = 1;
$l2 = 7;
$c1 = 97;
$c2 = 104;
if(
$l1 >= 1 && $l1 <= 8
&& $l2 >= 1 && $l2 <= 8
&& $c1 >= 97 && $c1 <= 104
&& $c2 >= 97 && $c2 <= 104
)
{
// ok
}
As the author clarified the rules of the code, the posting was reopened and the conversation became extensive, the comments were moved to the chat - Who wants to participate, read, add or clarify something just use the link provided.
– Bacco