Generate numbers in side div at random position without overlapping

前端 未结 3 1219
孤城傲影
孤城傲影 2021-01-18 10:00

I want to display random numbers inside a div at random positions without overlapping. I am able to display random number at random position but its going outside the box an

3条回答
  •  时光取名叫无心
    2021-01-18 10:37

    You can add to array position of each number. And then when ou generate new position for digit you should check if posx posy in array, if false place number there, if true generate new posx and posy

提交回复
热议问题