blocky/sh/fidx_random.sh
2022-09-07 11:39:21 +09:00

16 lines
214 B
Bash
Executable File

#!/bin/bash
# generate random feature indices
row=$1
col=$2
max=$3
for ((y = 0; y < row; ++y)); do
n=$((RANDOM%col + 1))
for ((x = 0; x < n; ++x)); do
printf "$((RANDOM%max)) "
done
printf "\n"
done