cigma wrote: ↑31 March 2024, 07:40
I'd be interested to know about the technical difference between "Undo" and "Confirm". I'd imagine that both use a similar kind of temporary memory, which is set back in case, but this is obviously not true after your description.
You have a keen eye for detail. They are indeed quite different. May I explain by way of analogy? When you're playing a game in person, you probably plan out your turn in your head before taking it. You can completely change your mind about the move and no one's the wiser. Once you actually move pieces, you've "confirmed" your move. At that point, you probably need to ask the other players if you want to take back your move and do something different instead.
Likewise, when you take actions in your web browser, it doesn't send your move to the server until you hit the confirm button. Other players can't see what you have planned until you do so. (If you've ever refreshed your browser at this point, you'll notice that the move wasn't saved and you have to redo it.) Once it's sent to the server, pieces have moved and undo'ing it requires figuring out how to revert the state. For some games, that's fairly simple, especially when playing in person. For others, it's definitely not.
I suppose you can call your browser (or your head when playing in person) a "temporary memory". Once pieces have moved, there's nothing temporary about it. Reverting the state requires the game to keep track of where everything just came from and when such a thing is allowed. You probably shouldn't be able to undo after rolling dice. If you undo after playing a card and that causes the discard pile to be shuffled, now you need to unshuffle it back to how it was, especially if that order was important to the game.
I think I've rambled beyond the scope of your question, but I hope that's helpful.