Finally got the undo feature working after 3 hours of work. I had a lot of issues throughout, and I think I can put it in 3 stages. In stage 1, I was trying to make the undo feature work by running inverse commands to get back to where you were (for example, undoing adding an idea by removing an idea). This wasn’t a good idea because it was making the undo function very large and complicated. The second stage was more just a new approach, instead of trying to undo the actual changes, I tried to fully replace the list with an older version. This was closer, but it ran into lots of errors when I tried to do it because of how I was creating objects and not getting rid of them correctly, and referencing things that didn’t exist, and overall making a mess of memory and lists. The technique however was made working when after too long of not knowing what was wrong (turns out a lot) I caved in and asked ChatGPT. Still not proud, but it did work. It showed me what I did wrong, and then I fixed it’s fix because it made a couple mistakes (it’s AI after all, so that makes sense). Now with these fixes, it works as intended to my relief.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.