What is the function of the statement (int)(Math.random()*6)+ 1
The method of generating random numbers will generate values in the range of [0, 1].
This sentence means that the value of [1, 7] will be generated, that is, [0,6]+1; The generated value is converted into an integer, so this value may be: 1, 2, 3, 4, 5, 6.