
Here is the code that inserts prime numbers into a list with code executed in Scratch!
The variables used are: N number that increments input of the algorithm that performs the primality test
factors: contains the factors of the number n and if factors are present, the countFactors is incremented
countFactors: counts how many factors are found of N
Attention to the mod operation that returns the remainder of the division
Here is the working code on the Scratch website of the MIT of Boston