IBM October 2020 – Challenge (control-flow graph)

https://www.research.ibm.com/haifa/ponderthis/challenges/October2020.html

This month’s challenge is dedicated to the memory of Frances Allen, who passed away in August. Among her many accomplishments is the invention of the control-flow graph, in her 1970 paper “Control flow analysis

My solution

with step number:

10 A = a
20 B = b
30 JMP_ZERO B 90
40 AA = A
50 BB = B
60 A = B
70 B = AA % BB
80 JMP 30
90 RETURN A


-----

without step number:

A = a
B = b
JMP_ZERO B 90
AA = A
BB = B
A = B
B = AA % BB
JMP 30
RETURN A

IBM Gadi submission result:

Thanks! This indeed computes the GCD, but the requirement on the number of paths is not fulfilled.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 − two =