diff options
author | RossTheRoss <msattr@gmail.com> | 2019-02-19 21:31:07 +0000 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-02-19 21:31:07 +0000 |
commit | 654f7221575d24048c397d9b8b9e7b45705e7075 (patch) | |
tree | cce85213ae61be80d3415d337c80a388be16a908 | |
parent | (More screaming) (diff) | |
download | homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar.gz homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar.bz2 homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar.lz homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar.xz homework-654f7221575d24048c397d9b8b9e7b45705e7075.tar.zst homework-654f7221575d24048c397d9b8b9e7b45705e7075.zip |
Recursion is bad
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk2/hw2_directory/strap012_2B.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ee1301/wk2/hw2_directory/strap012_2B.cpp b/ee1301/wk2/hw2_directory/strap012_2B.cpp index 2a600b4..3ed926c 100644 --- a/ee1301/wk2/hw2_directory/strap012_2B.cpp +++ b/ee1301/wk2/hw2_directory/strap012_2B.cpp @@ -24,17 +24,19 @@ int main () { if (i!=0){ intervalChange++; } do { + // STILL BROKEN if (travel=='B' && hourOG-intervalChange<0){ if (hourChange<12) { - intervalChange-=12; + intervalChange=12-hourChange; } else { - intervalChange=12-intervalChange; + intervalChange=hourChange-12; if (intervalChange>=13) { intervalChange-=12; } } timeChange++; } + // STILL BROKEN } while (intervalChange>12); if (intervalChange>=12) { //if (intervalChange !=12) {i |