First,Use random Function to create 3 invisible numbers second, Enter 5 arrangements which has three numbers then compare the invisible numbers with the entered numbers if the positions and quantity of invisible numbers and entered numbers be equal, print the entered numbers green
and if just the quantity of numbers get equal , print entered numbers blue
and if none of the positions and quantities be equal , print entered numbers black
for example:
note: must not use random function for arrangements numbers the numbers must be entered by users
when all third numbers got equal in both position and quantity with invisible numbers which has be chosen by random functions
(for example in this example in arrangement 5 user has got won this game )
print this message (congratulation! you got succeed.) .
the invisible numbers which has created by random function
| | | |
first arrangement of entered number
| 6
| 7 | 8
|
second arrangement of entered number | 3 | 2 | 1 |
third arrangement of entered number | 0 | 3 | 5 |
forth arrangement of entered number | 0 | 9 | 3 |
fifth arrangement of entered number | 0 | 4 | 3 |