Using the Range function with the Slot (#) function
Clear["Global`*"]
nRow = 10;
nCol = 25;
l = {Blue,
Disk[{3 Sin[5 t + 0.1 #[[1]]] + 1.4 #[[1]], 1.5 #[[2]]},
0.5]} & /@ Flatten[Array[{#1, #2} &, {nCol, nRow}], 1];
Animate[Evaluate[Graphics[l, PlotRange -> {{-4, 44}, All}]], {t, 0,
20. π}, AnimationRate -> .3]
Array
:
ClearAll[disks]
disks[t_, nc_, nr_] := Array[Disk[{3 Sin[5 t + 0.1 #] + 1.4 #, 1.5 #2}, 0.5] &, {nc, nr}];
Animate[Graphics[{Blue, disks[t, 25, 10]}, PlotRange -> {{-4, 44}, All}], {t, 0, 20. π},
AnimationRate -> .3]
Outer
:
ClearAll[disks2]
disks2[t_, nc_, nr_] := Outer[Disk[{3 Sin[5 t + 0.1 #] + 1.4 #, 1.5 #2}, 0.5] &,
Range @ nc, Range @ nr];
Animate[Graphics[{Blue, disks2[t, 25, 10]}, PlotRange -> {{-4, 44}, All}], {t, 0, 20. π},
AnimationRate -> .3]
same picture
Tuples
:
ClearAll[disks3]
disks3[t_, nc_, nr_] := Disk[{3 Sin[5 t + 0.1 #] + 1.4 #, 1.5 #2}, 0.5] & @@@
Tuples[Range /@ {nc, nr}];
Animate[Graphics[{Blue, disks3[t, 25, 10]}, PlotRange -> {{-4, 44}, All}], {t, 0, 20. π},
AnimationRate -> .3]
same picture
ClearAll[disks4]
disks4[t_, nc_, nr_] := Disk[#, .5] & /@
Tuples[{3 Sin[5 t + 0.1 Range[nc]] + 1.4 Range[nc], 1.5 Range[nr]}]
Animate[Graphics[{Blue, disks4[t, 25, 10]}, PlotRange -> {{-4, 44}, All}], {t, 0, 20. π},
AnimationRate -> .3]
same picture