Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Fractran/UNIX-Shell/fractran.sh
Normal file
19
Task/Fractran/UNIX-Shell/fractran.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#! /bin/bash
|
||||
program="1/1 455/33 11/13 1/11 3/7 11/2 1/3"
|
||||
echo $program | tr " " "\n" | cut -d"/" -f1 | tr "\n" " " > "data"
|
||||
read -a ns < "data"
|
||||
echo $program | tr " " "\n" | cut -d"/" -f2 | tr "\n" " " > "data"
|
||||
read -a ds < "data"
|
||||
|
||||
|
||||
t=0
|
||||
n=72
|
||||
echo "steps of computation" > steps.csv
|
||||
while [ $t -le 6 ]; do
|
||||
if [ $(($n*${ns[$t]}%${ds[$t]})) -eq 0 ]; then
|
||||
let "n=$(($n*${ns[$t]}/${ds[$t]}))"
|
||||
let "t=0"
|
||||
factor $n >> steps.csv
|
||||
fi
|
||||
let "t=$t+1"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue