#!/bin/csh -f
#-----------------------------------------------------------------------
# File    : ex19.csh
# Contents: sum number of steps for the register machine of example 3.8
#           for all input of size 2 (decimal representation)
# Author  : Christian Borgelt
# History : 26.11.1997 file created
#           05.12.1997 use of grep and expr eliminated
#-----------------------------------------------------------------------
@ sum = 0
@ i   = 10
while ( $i < 100 )
  @ sum += `rmsim 3.8 0 $i | gawk '($NF == "END") { print $1 }'`
  @ i++
end
echo $sum
