ScratchData LogoScratchData
Back to popswilson's profile

ChatGPT Computes the Collatz Conjecture

POpopswilson•Created August 17, 2023
ChatGPT Computes the Collatz Conjecture
19
11
242 views
View on Scratch

Instructions

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

Description

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.

Project Details

Project ID883269248
CreatedAugust 17, 2023
Last ModifiedSeptember 28, 2024
SharedAugust 17, 2023
Visibilityvisible
CommentsAllowed