Skip to content
Snippets Groups Projects
Commit 9e45522d authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

"NUM2CHAR" (universeller)

parent a5d34772
No related branches found
No related tags found
No related merge requests found
...@@ -56,14 +56,23 @@ dotPos[3]=${digitPos[3]} ...@@ -56,14 +56,23 @@ dotPos[3]=${digitPos[3]}
dotPos[2]=${digitPos[2]} dotPos[2]=${digitPos[2]}
dotPos[1]=${digitPos[1]} dotPos[1]=${digitPos[1]}
NUM2CHAR[0]='0'
NUM2CHAR[1]='1'
NUM2CHAR[2]='2'
NUM2CHAR[3]='3'
NUM2CHAR[4]='4'
NUM2CHAR[5]='5'
NUM2CHAR[6]='6'
NUM2CHAR[7]='7'
NUM2CHAR[8]='8'
NUM2CHAR[9]='9'
NUM2CHAR[10]='E'
for ((FNb=1; FNb<=MAX_FILES; FNb++)); do for ((FNb=1; FNb<=MAX_FILES; FNb++)); do
DPR=$((RANDOM % $NUMBER_OF_DIGITS + 1)) # random dot position (1..$NUMBER_OF_DIGITS) DPR=$((RANDOM % $NUMBER_OF_DIGITS + 1)) # random dot position (1..$NUMBER_OF_DIGITS)
for (( i=1; i<=$MAX_DIGITS; i++ )); do for (( i=1; i<=$MAX_DIGITS; i++ )); do
DNR[$i]=$((RANDOM % 10 + 1)) # random digit number (0..10) DNR[$i]=${NUM2CHAR[$((RANDOM % 10 + 1))]} # random digit number (0..10)
if [ ${DNR[i]} == 10 ]; then
DNR[$i]="E"
fi
if [ $DPR == $i ]; then if [ $DPR == $i ]; then
dotFile[$i]="$dotFile" dotFile[$i]="$dotFile"
DOT[$i]="." # dot character DOT[$i]="." # dot character
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment