File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ function showFiveMessages(message) {
44  setTimeout ( function ( )  { 
55    console . log ( message ) ; 
66  } ,  1000 ) ; 
7- } 
8- 
9- for  ( var  i  =  5 ;  i  <=  0 ;  i -- )  { 
10-   showFiveMessages ( message ) ; 
7+   for  ( var  i  =  5 ;  i  <=  0 ;  i -- )  { 
8+     showFiveMessages ( message ) ; 
9+   } 
1110} 
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>  
2+ < html  lang ="en "> 
3+   < head > 
4+     < meta  charset ="UTF-8 " /> 
5+     < meta  name ="viewport " content ="width=device-width, initial-scale=1.0 " /> 
6+     < meta  http-equiv ="X-UA-Compatible " content ="ie=edge " /> 
7+     < title > Document</ title > 
8+   </ head > 
9+   < body > 
10+     < script  src ="task8.js "> </ script > 
11+   </ body > 
12+ </ html > 
Original file line number Diff line number Diff line change 1+ let  bank  =  10000 ; 
2+ let  rate  =  1 ; 
3+ let  options  =  [ "Орел" ,  "Решка" ] ; 
4+ 
5+ for  ( i  =  0 ;  i  <=  5 ;  i ++ )  { 
6+   let  casino  =  Math . floor ( Math . random ( )  *  options . length ) ; 
7+   let  person  =  Math . floor ( Math . random ( )  *  options . length ) ; 
8+   if  ( bank  ==  0 )  { 
9+     alert ( `Вы проиграли, попытка: ${ i } ${ rate }  ) ; 
10+   }  else  if  ( person  ===  casino )  { 
11+     bank  +=  rate  *  2 ; 
12+     bank  -  rate ; 
13+   }  else  if  ( person  !==  casino )  { 
14+     bank  -=  rate ; 
15+     rate  *=  2 ; 
16+     bank  -  rate ; 
17+   }  else  { 
18+     alert ( `Вы победили, ваш банк: ${ bank }  ) ; 
19+   } 
20+ } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments