The dice menu has two different options.

In the first option, 2 standard dice are thrown randomly and the results are reflected on the screen. If desired, the results of these dice are recorded and the user is asked whether he wants to roll the dice again.

In the second option, all recorded dice1 and dice2 results are listed.

The dice will remain registered until they are completely exited from the program. For example, if the 2nd application is run after the 5th application is exited and then the 5th application is run again, the information of the previously saved dice should be able to be used.

That's an odd question there with "how can the code" as title.

Your title didn't ask a question and the post's body just seems to copy out what methods and functions may do.

What's the question here as well as your attempt at code and what issues are you trying to solve?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.