I asked the AI program ChatGPT to write a program in Scratch that computes the Collatz Conjecture, Below is the code ChatGPT returned. when green flag clicked ask [What number?] and wait set [n] to (answer) repeat until <(n) = (1)> if <(n) mod (2) = (0)> set [n] to (n) / (2) else set [n] to (n) * (3) + (1) end say (n) end
I used ChatGPT. ChatGPT generated the logic using the language of Scratch and I just translated what is printed above in the Instructions into Scratch blocks. I added the frog sprite from the Scratch Library to liven up the code a bit.