B4A Question Rnd function gives upper half of numbers only - alwaysbusy (first post)    Feb 01, 2024   (3 reactions) I tried your code and seems fine to me. I get all kind of values for BPM:
#, ErrorTime: 1706743178712, DTN: 1706769942615, LastBeatTime: 26763124, BPM: 77, TIM: 779
#, ErrorTime: 1706743177714, DTN: 1706769942617, LastBeatTime: 26763903, BPM: 60, TIM: 1000
#, ErrorTime: 1706743174859, DTN: 170676 B4A Question B4XSwitch - I can't programmatically set the state - emexes (first post)    Feb 13, 2024   (4 reactions) <JOKE> or the compromise solution: Switchrbtn10cut.Value = Rnd(0, 2) = 1 or the contrarian solution: Switchrbtn10cut.Value = Not(Rnd(0, 2) = 1) Switchrbtn10cut.Value = 1 - Rnd(0, 2) = 1 </JOKE> Wish Rnd max inclusive - JordiCP (first post)    Sep 04, 2018   (1 reaction) (I guess) it is because the original Java (java.util.Random) function already works like this. The function
int nextInt(int bound);
returns an integer between 0 and bound-1
In order to keep things coherent, the B4A/J function Rnd(min,max) adds 'min' to the result of the above function. B4A Library CircleTimeView - Johan Schoeman    Sep 24, 2017   (15 reactions) QuarterNumbersTextSize = Rnd(20, 40) ctv1.TimeNumbersTextSize = Rnd(30, 50) ctv1.MarkLineColor = Colors.ARGB(255, Rnd(100, 255), Rnd(100, 255), Rnd(100, 255)) ctv1.MarkSize = Rnd(1,21) ctv1.HighlightMarkLineColor = Colors.ARGB(255, Rnd(100, 255), Rnd(100, 255), Rnd(100, 255)) ctv B4A Question images random - DonManfred (first post)    Aug 23, 2022 Dim random As Int = Rnd(1,5) B4i Question Generate a random number between two numbers - klaus (first post)    Mar 27, 2015   (1 reaction) From the documentation. Rnd(Min As Int, Max As Int) Min inclusive, Max exclusive. Generate a number bertween 1 and 100: N = Rnd(1, 101) B4A Question RND - DonManfred (first post)    Mar 03, 2015   (1 reaction) 1. Please use CODE tags when posting code here. BTW: Code tags are not using < or >. They need !
correct.
to generate a rnd from 1 to 100
you need to call
dim r as int = RND(1,101)
btw: Due to this the command
xc = Rnd(0,Shuffel.Size -1)
' should be
xc = Rnd(0,Shuffel.Size) B4A Question Random Number - Antonio Costa    Mar 17, 2018 Rnd(1,101)) SetButtonTextSize(buttonC, Rnd(1,101)) SetButtonTextSize(buttonD, Rnd(1,101)) SetButtonTextSize(buttonB, resultInt) buttonB.Text = resultInt Else if testLevel = 5 Then num1 = Rnd(1,10) 'da un numero random tra 1 e B4A Example FREE Source Code's ! - ilan (first post)    May 19, 2016   (2 reactions) r = Rnd(2,25) circle.x = Rnd(circle.r,MainForm.RootPane.Width-(circle.r*2)) circle.y = Rnd(circle.r,MainForm.RootPane.Height-(circle.r*2)) overlap = False For j = 0 To circle_list.Size - 1 old_crl = circle_list.Get(j) If distance_x(circle.x,ol B4J Code Snippet Random Hexcolor Generator - kimstudio (first post)    Oct 18, 2022   (1 reaction) Rnd(min, max) min inclusive and max exclusive, so I assume what emexes means is that it should be
Dim idx As Int = Rnd(0, hexValues.Size) Page: 1   2   3   4   5   6   7   Powered by ColBERT |