# Appending Random Number to Existing List

My goal is to append random number to list like below.The problem is whenever I try appending a random number, the previously created numbers are changed which I don't know why. How to add a random number without changing existing number?

Manipulate[ Nest[(Append[#, RandomInteger[10]]) &, {}, i], {i, 1, 5, 1}]}]


※Althogh I tried Nest and Pure function as above, result was happened as the same as code below.

Manipulate[ Table[RandomInteger[10], i], {i, 1, 5, 1}]

• Generate first, display later: SeedRandom[1]; With[{num = Nest[(Append[#, RandomInteger[10]]) &, {}, 5]}, Manipulate[num[[1 ;; i]], {i, 1, 5, 1}] ] ? or please elaborate how you intend to use this.
– Syed
Commented Nov 9, 2023 at 14:48
• Or start with a fixed seed: Manipulate[Nest[(Append[#, RandomInteger[10]]) &, SeedRandom[1]; {}, i], {i, 1, 5, 1}] Commented Nov 9, 2023 at 14:57

If you want to just hide/reveal parts of a randomly generated list, you can do this:

With[
{listLength = 5},
With[
{fullList = RandomInteger[10, listLength]},
Manipulate[Take[fullList, i], {i, 1, 5, 1}]]]


If you want "real time" randomness, you might do something like this:

DynamicModule[
{list = {}, maxLength = 5},
Manipulate[

Manipulate[SeedRandom[1]; Table[RandomInteger[10], i], {i, 1, 5, 1}]