I was thinking of somehow creating procedurally generated homework, but (1) that's not very easy, and (2) the generated homework might not contain an equal amount of learning potential. Is there a way to design homework so people will be motivated not to cheat? Then I thought of the game The Witness. It's a puzzle game and does not contain any instructions. In the game, some puzzles took a lot of time for me to solve, but I never considered looking at the solution, and I think this is not because of me but because of the game's design. You gain nothing by simply cheating and looking for a solution. On the contrary, you would probably feel bad if you looked at a solution. But in real life, even if you assign completing The Witness as homework, I think students would still be motivated to cheat to get a good GPA. Though, if you take your time and design interesting homework that would not take so much time for the students, and at the same time, it would be educational enough to serve the purpose, I think people would be unwilling to share their work with others.
Edit (21/12/2022): Now have fun with ChatGPT :D I think one really needs to design a fun programming project; otherwise, you will be ChatGPT'ed.