Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st April 2018, 21:20 | #2 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
21st April 2018, 21:48 | #3 | Link | |
Registered User
Join Date: Oct 2015
Posts: 97
|
Quote:
Code:
Subtitle("Hello world!", align= rand(9)) Last edited by wthreex; 21st April 2018 at 21:55. |
|
21st April 2018, 22:48 | #4 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
try seed=true. With seed=false it did change 1-2 times, but even after restarting the vdub it stayed at 5. So maybe it's a bug?
This works much better Code:
r=rand(max=9, seed=true) version() Subtitle(String(r), align= round(r))
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
22nd April 2018, 00:44 | #5 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Code:
#r=rand(max=9, seed=true) # Int, Range 0 to 8, no good (result is modulo 9) r=rand(max=9,seed=true)+1 # Int, Range 1 to 9 version() Subtitle(String(r), align=r) # Align=0, is illegal Code:
rand(seed=true) # One time Randomize() # r=rand(max=9)+1 # Int, Range 1 to 9 version() Subtitle(String(r), align=r) # Align=0, is illegal
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 25th April 2018 at 20:04. |
25th April 2018, 18:22 | #7 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Code:
#r=rand(max=9, seed=true) # Int, Range 0 to 8, no good (result is modulo 9) r=rand(max=9,seed=true)+1 # Int, Range 1 to 9 version() Subtitle(String(r), align=r) # Align=0, is illegal version() Subtitle(String(r), align=r) # Align=0 is illegal, 10 too. In the end to have a randomly moving watermark, rand would have to be evaluated for every frame, and position be calculated from that, maybe not using align, but this hasn't been asked.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 25th April 2018 at 18:26. |
25th April 2018, 19:36 | #8 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
BINGOS=0 Rand(seed=true) For(i=1,50) { r=Rand(Max=8)+1 # Int, range 1 to 8 BINGOS=(r==9)?BINGOS+1:BINGOS RT_DebugF("%d] %d %s",i,r,r==9?"BINGO":"") } RT_DebugF("\nNumber of 9's = %d",BINGOS) return version Code:
00000005 1.23400939 RT_DebugF: 1] 2 00000006 1.23405778 RT_DebugF: 2] 7 00000007 1.23410249 RT_DebugF: 3] 1 00000008 1.23414886 RT_DebugF: 4] 4 00000009 1.23418772 RT_DebugF: 5] 6 00000010 1.23423040 RT_DebugF: 6] 7 00000011 1.23427629 RT_DebugF: 7] 5 00000012 1.23431504 RT_DebugF: 8] 8 00000013 1.23435771 RT_DebugF: 9] 2 00000014 1.23440421 RT_DebugF: 10] 5 ... 00000044 1.23567069 RT_DebugF: 40] 4 00000045 1.23570931 RT_DebugF: 41] 8 00000046 1.23575175 RT_DebugF: 42] 1 00000047 1.23579741 RT_DebugF: 43] 4 00000048 1.23583603 RT_DebugF: 44] 6 00000049 1.23587847 RT_DebugF: 45] 4 00000050 1.23592424 RT_DebugF: 46] 4 00000051 1.23596275 RT_DebugF: 47] 2 00000052 1.23600531 RT_DebugF: 48] 4 00000053 1.23605096 RT_DebugF: 49] 2 00000054 1.23608959 RT_DebugF: 50] 5 00000055 1.23612595 RT_DebugF: 00000057 1.23616958 RT_DebugF: Number of 9's = 0 Code:
ColorBars.KillAudio.ShowFrameNumber Rand(seed=true) # seed only once (As 'Randomize()' in other languages) Global BINGOS=0 SSS=""" n=current_frame r=rand(max=9)+1 # Int, Range 1 to 9 Global BINGOS=(r==9)?BINGOS+1:BINGOS RT_DebugF("%d] %d",n,r) Subtitle(String(n,"%.0f]")+String(BINGOS," BINGOS=%.0f : ")+String(r,"R=%.0f"), align=r) # Align=0, is illegal return last """ return ScriptClip(SSS) Quote:
Code:
Rand(max=n) # Range 0 to n-1 Rand(max=n)+1 # Range 1 to n
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 25th April 2018 at 19:58. |
||
Tags |
avisynth, function, number, random |
Thread Tools | Search this Thread |
Display Modes | |
|
|