- Posts: 32
- Karma: 4
- Thank you received: 4
Please Log in or Create an account to join the conversation.
[random]
rand0=3& rand0:[label0 label1 label2 label3]play_phrase:
& M0=M0+1
& M0:[label1 label3 label2 label0 label1 lablel2 label3 label0] M0=0 play_phrasePlease Log in or Create an account to join the conversation.
rand0=1newRandomNumber:
& rand0=1
& buttonbutton:
& rand0?M1:newRandomNumber
& rand0:[play1 play2]
& end ; stop the program and enter low power mode
play1:
& one.wav
& M1=0
& end
play2:
& two.wav
& M1=1
& endPlease Log in or Create an account to join the conversation.
rand0=1rand0:[play1 play2]button:
& delay(0.020) ; small delay to guarantee a new random number is generated
& M2=rand0 ; get a random number and store in M2
& M2?M1:button ; compare new and last random number. If same, jump back to button:
& M2:[play1 play2] ; otherwise, jump to label based on new random number
play1:
& one.wav
& M1=0
& end
play2:
& two.wav
& M1=1
& endPlease Log in or Create an account to join the conversation.
button:
& delay(.02) ; small delay to guarantee a new random number is generated
& M0=rand0 ; get a random number from 0-15
& M1=rand1 ; get another random number from 0-4
& M1=M1+1 ; move second random number from 0-4 to 1-5
& X1=M0*M1 ; mult first and second random numbers together to get 0-70
& X2?X1:button ;make sure we don't play the same sound twice
& X2:[play1 play2 play3 play4 play5 ... play62]
& end ; stop the program and enter low power modePlease Log in or Create an account to join the conversation.
; use the first random variable to randomly select one of nine arrays
& rand0:[array0 array1 array2 array3 array4 array5 array6 array7 array8 ]
; then use the second random variable to randomly call one of seven paths
array0:
& rand1:[path0 path1 path2 path3 path4 path5 path6 ]
array1:
& rand1:[path7 path8 path9 path10 path11 path12 path13 ]
; ... and so on until all nine arrays and all 63 paths are accounted forPlease Log in or Create an account to join the conversation.