Captcha : more simple addition

This commit is contained in:
Adrien Bourmault 2021-01-14 12:17:22 +01:00 committed by root
parent 57e7ec7c7e
commit f3295d957e

View File

@ -32,21 +32,6 @@ else
}
fi
DECOUPE()
{
LENGTH=${#INPUT}
MID=$((LENGTH / 2))
get_random
R=$(($R % 2))
if [[ $R -eq 1 ]]; then
echo "Tapez ${INPUT:0:$MID}\n suivi de ${INPUT:$MID:$MID}"
else
echo "Saisissez ${INPUT:0:$MID}\n puis ${INPUT:$MID:$MID}"
fi
}
INTRUS()
{
LENGTH=${#INPUT}
@ -94,7 +79,9 @@ INTRUS()
SOMME()
{
get_random
RA=$(($R % 100))
RB=$(($R % 5))
get_random
RA=$(($R % 10 * (10 ** $RB)))
if [[ $(($INPUT % 2)) -eq 0 ]]; then
A=$(($INPUT - $RA))
@ -128,7 +115,7 @@ RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]}))
convert -size 300x60 xc:none -pointsize 20 \
\( -clone 0 -fill black \
-stroke black -strokewidth 1 \
-annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[$RAND_INDEX]})" \
-annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[1]})" \
-roll +$ROLL_X+0 \
-wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \
-roll -$ROLL_X+0 \) \