Highlights of the 13th Lanqiao Cup Scratch Provincial Competition

Programming Questions
Question 1 Questions and Answers Counting
Game
Title Description
Background information:
5 boys and 3 girls, 8 people form a circle, given a number n (2 is less than or equal to n is less than or equal to 5). Start counting in turn from the first one, and when the number is n, the person leaves the circle. Then the next one starts counting from 1, and the person who reports to m again leaves the circle, and the game is played in this way until there are only 5 people. At the beginning of the game, what kind of arrangement should be adopted so that the girls who leave the circle every time are girls, and the remaining 5 people are boys.
For example, when the given number is 3, the person who reports 3 will leave Yuankuo each time.
Blue circles: boys, red circles: girls.

Programming realization
Counting game (initially counting clockwise from 1)
Specific requirements:
1). Click the green flag, and the kitten says: "5 boys, 3 girls, 8 people in total";


 

2). After 2 seconds, the kitten said: "The number of reports is 2";
according to the fact that boys are blue and girls are red, and each time the person who reports 2 leaves the circle, boys and girls are correctly displayed in the complex. The initial position in the round of the game is such that the 5) left after the 3 rounds of counting are all boys;
3). After 2 seconds, the kitten said: "The count is 3";
according to the blue for boys and red for girls, Every time the person who reported 3 leaves the circle, the initial positions of the boys and girls in this round of the game are correctly presented in the complex stage so that the 5 people left after the 3 rounds of counting are all boys; 4). After 2 seconds
, The kitten said: "The number is 4

Guess you like

Origin blog.csdn.net/IT_Scratch/article/details/130903641