We can use a set to perform this interesting test, input the names of one or two people, and the system automatically generates a sentence. Some words in this sentence are randomly combined, in this way, the random sentences are interesting.
First, control the game to start:
The following defines several sets and stores the compiled statements used to form a sentence:
Start to enter the names of two people, which are stored in name1 and name2 respectively:
Then, the random number generator is used to generate a random number between 0 and 7 because each part of the sentence has eight elements. Here we define five sets to generate five random numbers at a time, put N [] into the array, and then use the array n [] for the display operation:
Now the game is created.
Game effects include:
Enter name
Test Results
This game and its program file download Network Disk:
Http://pan.baidu.com/s/1sjlWM7b
Very interesting. If you are interested, try it out and support Windows 7 and later operating systems.
Fun games to test what you have done