Author: Stan Eisenstat
Subject: Re: [Cs223] Infinite Loops Check
Date: Monday, 24 Feb 2020, 20:31:42
> Message Posted By: Unknown > > Hwk3/strwrs checks for infinite loop at the end of a lowercase > substitution rule, for instance: > echo aaaaaaaa | /c/cs223/Hwk3/strwrs -v -Rn a a: > F=a T=a POS=0 OLD=aaaaaaaa NEW=aaaaaaaa > ..... > POS=7 OLD=aaaaaaaa NEW=aaaaaaaa > Is there any harm in instead checking it only between the OLD and NEW at > each POS, i.e. after each substitution is made, but not comparing it with > the original input gotten through getline()? I can think of cases in which > this would fail, but they would require multiple substitution rules, which > are not detected by Hwk3/strwrs. I cannot see an harm, but this would not work if Fi could contain a wildcard that matched any character (but wildcards are not part of this assignment). --Stan-PREV INDEX NEXT