Captcha : replace digits by words in INTRUS
This commit is contained in:
parent
3276a09029
commit
16827ba1ab
@ -16,6 +16,7 @@
|
|||||||
INPUT=$1
|
INPUT=$1
|
||||||
|
|
||||||
TRANSFORMATIONS=(INTRUS SOMME)
|
TRANSFORMATIONS=(INTRUS SOMME)
|
||||||
|
DIGIT=(zéros uns deux trois quatres cinqs six septs huits neufs dix)
|
||||||
|
|
||||||
if test -n ${BASH_VERSION:-''} ; then
|
if test -n ${BASH_VERSION:-''} ; then
|
||||||
get_random ()
|
get_random ()
|
||||||
@ -53,7 +54,7 @@ INTRUS()
|
|||||||
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
||||||
INTRUS=-1
|
INTRUS=-1
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9
|
for i in 0 1 2 3 4 5 6 7 8 9
|
||||||
do
|
do
|
||||||
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
||||||
INTRUS=$i
|
INTRUS=$i
|
||||||
@ -84,9 +85,9 @@ INTRUS()
|
|||||||
R=$(($R % 100))
|
R=$(($R % 100))
|
||||||
|
|
||||||
if [[ $R -lt 50 ]]; then
|
if [[ $R -lt 50 ]]; then
|
||||||
echo "Tapez $NEWINPUT en\n supprimant les $INTRUS"
|
echo "Tapez $NEWINPUT en\n supprimant les ${DIGIT[$INTRUS]}"
|
||||||
else
|
else
|
||||||
echo "Saisissez $NEWINPUT en\n enlevant les $INTRUS"
|
echo "Saisissez $NEWINPUT en\n enlevant les ${DIGIT[$INTRUS]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
INPUT=$1
|
INPUT=$1
|
||||||
|
|
||||||
TRANSFORMATIONS=(INTRUS SOMME)
|
TRANSFORMATIONS=(INTRUS SOMME)
|
||||||
|
DIGIT=(zéros uns deux trois quatres cinqs six septs huits neufs dix)
|
||||||
|
|
||||||
if test -n ${BASH_VERSION:-''} ; then
|
if test -n ${BASH_VERSION:-''} ; then
|
||||||
get_random ()
|
get_random ()
|
||||||
@ -53,7 +54,7 @@ INTRUS()
|
|||||||
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
SORTED_UNIQ_NUM=$(echo "${NUMBERS[@]}" | sort -u | tr '\n' ' ')
|
||||||
INTRUS=-1
|
INTRUS=-1
|
||||||
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9
|
for i in 0 1 2 3 4 5 6 7 8 9
|
||||||
do
|
do
|
||||||
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
if [[ ! " ${SORTED_UNIQ_NUM[@]} " =~ " ${i} " ]]; then
|
||||||
INTRUS=$i
|
INTRUS=$i
|
||||||
@ -84,9 +85,9 @@ INTRUS()
|
|||||||
R=$(($R % 100))
|
R=$(($R % 100))
|
||||||
|
|
||||||
if [[ $R -lt 50 ]]; then
|
if [[ $R -lt 50 ]]; then
|
||||||
echo "Tapez $NEWINPUT en\n supprimant les $INTRUS"
|
echo "Tapez $NEWINPUT en\n supprimant les ${DIGIT[$INTRUS]}"
|
||||||
else
|
else
|
||||||
echo "Saisissez $NEWINPUT en\n enlevant les $INTRUS"
|
echo "Saisissez $NEWINPUT en\n enlevant les ${DIGIT[$INTRUS]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user