File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 3838
3939    # check signal strength 
4040    if  cycle  %  period  ==  offset :
41-         print (cycle )
4241        signal_strength  +=  cycle  *  X_register 
4342
4443    # update X_register 
5150print (signal_strength )
5251# %% 
5352
53+ import  time 
5454
5555cycle  =  0 
5656X_register  =  1 
7979            current_number  =  int (command [5 :])
8080            addx_flag  =  2 
8181
82-     if  cycle  %  period  ==  offset :
83-         print ("" )
84- 
8582    position  =  (cycle  -  1 ) %  period 
8683    if  abs (position  -  X_register ) <=  1 :
87-         print ("# " , end = "" )
84+         print ("█ " , end = "" ,  flush = True )
8885    else :
89-         print ("." , end = "" )
86+         print (" " , end = "" , flush = True )
87+ 
88+     if  cycle  %  period  ==  offset  -  1 :
89+         print ("" )
90+ 
91+     print ("_" , end = "" , flush = True )
92+ 
93+     time .sleep (0.02 )
94+ 
95+     print ("\b " , end = "" , flush = True )
9096
9197    # update X_register 
9298    if  addx_flag  ==  2 :
9399        addx_flag  =  1 
94100    elif  addx_flag  ==  1 :
95101        addx_flag  =  0 
96102        X_register  +=  current_number 
97- 
98- print (signal_strength )
99- 
100103# %% 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments