AliMD / 1Tuts

:+1: Web Design Technology Tutorials
http://ali.md/tuts
62 stars 41 forks source link

Rahnamaii mikonid lotfan? plz. #624

Closed koorosh13hm closed 10 years ago

koorosh13hm commented 10 years ago

Dar kode kheyli sadeye zir faghat "First part" kar mikonad. Lotfan man ra rahnamayii konid ke chera console, "Second part" ra faghat yek bar khorooji midahad !! az lotfe shoma sepas gozaram.

https://gist.github.com/Rabioso/8202744

AliMD commented 10 years ago

be setInterval dovom yek adade random yani javabe bargashti function mirese na khode function doroste yeki azin 2raveshe

//Second part:
function getRandomInt (min , max){
  console.log(Math.floor(Math.random() * (max - min + 1) + min));   
};

function timer () {
  getRandomInt(0 , 15)
}

setInterval(timer , 1000);

ravesh herfeyi tar

//Second part:
function getRandomInt (min , max){
  console.log(Math.floor(Math.random() * (max - min + 1) + min));   
};

setInterval(getRandomInt , 1000, 0, 15);

dar zemn ma function ro be yeli az in do shekl tarif mikonim va na tarkibi az hardosh

// First part
var randomizer = function (){
  console.log(Math.random());
};

ya

// First part
function randomizer (){
  console.log(Math.random());
};
koorosh13hm commented 10 years ago

Aghaye aziz, mesle hamishe mamnoonam.

omidgharib commented 10 years ago

manam yek chizi yad gereftam mamnun az har2 :+1: