Author: Unknown
Subject: Infinite Loops Check
Date: Monday, 24 Feb 2020, 13:12:34
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.PREV INDEX NEXT