Create a string from tuples returned by parse_string.
(prog_tuple)
| 240 | |
| 241 | |
| 242 | def tuple_to_string(prog_tuple): |
| 243 | """Create a string from tuples returned by parse_string.""" |
| 244 | (roman, acc, suff) = prog_tuple |
| 245 | if acc > 6: |
| 246 | acc = 0 - acc % 6 |
| 247 | elif acc < -6: |
| 248 | acc = acc % 6 |
| 249 | while acc < 0: |
| 250 | roman = "b" + roman |
| 251 | acc += 1 |
| 252 | while acc > 0: |
| 253 | roman = "#" + roman |
| 254 | acc -= 1 |
| 255 | return roman + suff |
| 256 | |
| 257 | |
| 258 | def substitute_harmonic(progression, substitute_index, ignore_suffix=False): |
no outgoing calls
no test coverage detected