Véletlen számok
This commit is contained in:
1 parent
636b5acb6a
commit
b4e3fc5eb6
2 files changed
+42
No files matched your search
@@ -0,0 +1,24 @@
|
||||
|
||||
let veletlen=Math.random();
|
||||
|
||||
console.log(veletlen);
|
||||
|
||||
//Egész szám megadott határok között
|
||||
|
||||
veletlen=Math.random()*10;
|
||||
|
||||
console.log(veletlen);
|
||||
|
||||
veletlen=Math.floor(Math.random()*10)+1;
|
||||
|
||||
console.log(veletlen);
|
||||
|
||||
veletlen=Math.floor(Math.random()*(100-10))+10;
|
||||
|
||||
console.log(veletlen);
|
||||
|
||||
function veletlenSzam(min,max){
|
||||
return Math.floor(Math.random()*(max-min))+min;
|
||||
}
|
||||
|
||||
console.log(veletlenSzam(5,25));
|
||||
Reference in new issue
Block a user