@B1KMusic intresting well im too used to vb so that is why i use wired syntax here any way in vb best way to randomize a number is to creat an object of the "random" class and with that randomize a varible so its like (if you know vb): Dim a As Integer Dim b As New Random a = b.Next(1, 200)
and 1 is the lower number
and 200 is the higher number
so that is why i love vb its good for making programs that you need to make fast for practical uses
View my channel to find a link to my web development blog! I made it to get my ideas out and shows you how to do it. give it a look and make one and blog with me! we can start a little community of bloggers and share ideas! see you soon!
buddy! im dissapointed, i found the rounding one, finally. but im tryina do this with a variable. N it doesnt work like that for some reason with variables. please make a new vid? sfe
i can't believe you are doing all this for free :O im going to college soon for an I.T course and im sure this will help :) also what is your job and do you have any qualifications as you are so good :)
all these tutorials are the fuckin shit, youve helped me in my school classes by simplifyin it, thanks a bunch man, by the way u got any tutorials on using the date object cheers.
What if you want the randomly generated number to be an integer? Do you have to generate a random fraction and then round it? Or is there a simpler way?
Also, how can you specify that you want it to be a certain length or certain number of decimal places?
the nuber of Math.random() is always a decimal number between 0 and +1. To have a number between 0 and +1000 you multiply it. Let's say you want it in a variable
var num1 = Math.random()*1000
To get rid of the excess decimal you can now round them off:
var num1 = Math.round(Math.random()*1000)
and to make this a decimal number between 0 and +10 you just divide it by 100
@B1KMusic intresting well im too used to vb so that is why i use wired syntax here any way in vb best way to randomize a number is to creat an object of the "random" class and with that randomize a varible so its like (if you know vb): Dim a As Integer Dim b As New Random a = b.Next(1, 200)
and 1 is the lower number
and 200 is the higher number
so that is why i love vb its good for making programs that you need to make fast for practical uses
xray5632 1 month ago
var num1 = (Math.random())
if (num1<= 1) alert ("number is not int");
xray5632 1 month ago
Comment removed
B1KMusic 1 month ago
This has been flagged as spam show
@xray5632 problems with this script:
1: syntax
2: 0 is an integer, so is -1, so is +1
3: Math.random never produces an integer, it always comes up with something like 0.4936429364298476. It only produces in integer if you tell it to
B1KMusic 1 month ago
its funny that you mentioned game, i was thinking im never using random but you mentioned game... -_- lol
iAckeh 5 months ago
View my channel to find a link to my web development blog! I made it to get my ideas out and shows you how to do it. give it a look and make one and blog with me! we can start a little community of bloggers and share ideas! see you soon!
IDmann700 6 months ago
var i=0
while(i<=1000){document.write(Math.round(Math.random()));i++}
JKTCGMV13 6 months ago
deal
TheOriginalVZdemon 7 months ago
here is a full html and javascript calculator code mikelsblog.co.cc/calculator.txt
mikekevinvideos 7 months ago
whole numbers can be negative!!!!
sudhanwaaaaa 8 months ago
@sudhanwaaaaa no , really?
gruntlover2 8 months ago
wholw numbers can be negative!!!!
sudhanwaaaaa 8 months ago
buddy! im dissapointed, i found the rounding one, finally. but im tryina do this with a variable. N it doesnt work like that for some reason with variables. please make a new vid? sfe
jbatley1 8 months ago
i can't believe you are doing all this for free :O im going to college soon for an I.T course and im sure this will help :) also what is your job and do you have any qualifications as you are so good :)
THEXMAN4509 8 months ago
where can you find all the built in strings
ipodhackskid 9 months ago
Hey Bucky are you still around? i note your videos are about 2 years old. Just wanted to know how you're keeping.
leketoob 10 months ago
looks lik there are newer videos too.. shall i follow this one or skip and jump to that one, MASTER!
nithin2c 11 months ago
excellent tutorials, by far the best i've seen on here...
evaloutionofman 1 year ago
Comment removed
evaloutionofman 1 year ago
random is my favorite function .. it can be useful in many things!!
HawxTeamDelta 1 year ago
you get asked about notepad++ in almost every video! lol
jamesmattking1 1 year ago
@jamesmattking1 so true...even i was wondering about this thing..notepad++ has taken stakes over javascripts ..i guess:P
prakash2187 1 year ago
random.. does the pokemon games use this? LoL i use the random to get the numbers to be used in lottery. LoL
13053121k0 1 year ago
Lulz, whole numbers can be negative? O'really?
Okay, whole numbers can't. You must have meant integers.
n1a1s1i1m 1 year ago
What is the equivalent of Notepad++ in Linux?
Thanks for your videos! They are very handy.
Cheers
lialia73 1 year ago
very good
aSuSm3wLaD 1 year ago
all these tutorials are the fuckin shit, youve helped me in my school classes by simplifyin it, thanks a bunch man, by the way u got any tutorials on using the date object cheers.
captamerica316 1 year ago
two empty _parameters_ ???????!?!?!?!
"When I use a word, it means what I want it to mean" - Humpty Dumpty
gf133 1 year ago
u hav the best tutorials!!! c++, java, javascript....and im sure u hav html, css, asp, php tutorials too.
dagemable 2 years ago
Nice One. Bring on the advanced code.
TheWernerbronkhorst1 2 years ago
Your website isn't working. Just some text and digg, yahoo and google
cytt 2 years ago
thenewboston
can you type your web address please
chard1964 2 years ago
how to subscribe to your site ?
on teh link in "info" is just some silly survival video :D
ivanjakovl 2 years ago
This comment has received too many negative votes show
I would subscribe, but your freakin porny!
Stardust342 2 years ago
What if you want the randomly generated number to be an integer? Do you have to generate a random fraction and then round it? Or is there a simpler way?
Also, how can you specify that you want it to be a certain length or certain number of decimal places?
QuantumAnomaly 2 years ago
the nuber of Math.random() is always a decimal number between 0 and +1. To have a number between 0 and +1000 you multiply it. Let's say you want it in a variable
var num1 = Math.random()*1000
To get rid of the excess decimal you can now round them off:
var num1 = Math.round(Math.random()*1000)
and to make this a decimal number between 0 and +10 you just divide it by 100
var num1 = Math.round(Math.random()*1000)/100
heyawhaw 2 years ago
thank u very much u r really good instructor
hadola75 3 years ago
is it possable to pick a random number between numbers EX) pick a number between 1 and 10
edison700 3 years ago
ur site is down
Snazzydog333 3 years ago
im working on all of my websites right now to redesign them all. they should be up in a couple weeks.
thenewboston 3 years ago
what program are you usin?
elitegrim 3 years ago
notepad++
just go to google and type it in and you can download it there. its free and its the best editor that's out there!
thenewboston 3 years ago
thank you so much dude
elitegrim 3 years ago
is it better than komodo?
Phillysoul11 2 years ago
much
Wowccraft 2 years ago
@thenewboston Maybe best free editor, but dreamweaver is so better. I use it.
ZombeTheImmortal 1 year ago
there sure is you have to add the boundaries in the parameters, ill show you in the next tutorial!
thenewboston 3 years ago