(direction, previousInt, currentInt)
| 22 | |
| 23 | |
| 24 | def breakDirection(direction, previousInt, currentInt): |
| 25 | # Get direction |
| 26 | difference = currentInt - previousInt |
| 27 | # Check if directions is maintained |
| 28 | if direction > 0: |
| 29 | # If direction and difference have the same pattern |
| 30 | return difference < 0 |
| 31 | # Else return the opposite |
| 32 | return difference > 0 |