Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is this the best way? (repeat code random number of times)
#1
Hey guys, can anyone help me out here.

i would like to use this code in conjunction with uniform function trouble is, is dont know how to use it as im very new, i have looked at the threads on random/random numbers and uniform function, but still do not understand how to link, so that i can pick a random number between 1 and 49 and then output/use that number in a Rep statement so that it repeats a random number of times. Kudos to Ken Gray for giving me the starting code below. Any help greatly aprreciated,

Any Help Greatly appreciated
Kind Regards
Paul, confused newbie lol

_i=Uniform(1 49)
rep _i
#2
Regarding that code, downlaod this file at the bottom of the page, and import it into Quick Macros. After doing so then try this code:

Code:
Copy      Help
_i=Uniform(1 49)
rep _i
,your code here

I hope this is what your wanting.


Attached Files
.qml   Uniform Function.qml (Size: 1.2 KB / Downloads: 319)
Taking on Quick Macros one day at a time
#3
thats some nice work you did.
i think you should put an example macro to your qml.

Uniform_Example
Code:
Copy      Help
out
int repeats count
repeats=Uniform(1 49)
out "Random repeats = %i" repeats
rep repeats
,out count
,count+1
pi
#4
Many thanks guys! greatly appreciated!

Smile
#5
Here we go, Uniform Function with _pi's example:


Attached Files
.qml   Uniform Function.qml (Size: 1.35 KB / Downloads: 660)
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)