SEE IT                                                                      
                                                                                  
      Read      the   code     like   a  story                                    
                                                                                  
                                                                                  
                                                                                  
      Predict first. Then run it in the online editor.                            
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        import random                                                             
        target_x = random.randint(-2, 2)                                          
        target_y = random.randint(-2, 2)                                          
        x = int(input("Choose x (-2 to 2): "))                                    
        y = int(input("Choose y (-2 to 2): "))                                    
        if x == target_x and y == target_y:                                       
            print("Star caught!")                                                 
        else:                                                                     
                                                                                  
            print("Star was at", target_x, target_y)                              
                                                                                  
                                                                                  
        ONE POSSIBLE OUTPUT                                                       
                                                                                  
        Choose x (-2 to 2): 1                                                     
        Choose y (-2 to 2): -1                                                    
        Star caught!                                                              
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
        CODE DETECTIVE                                                            
                                                                                  
        Point to the part that can change. Point to the part that produces output. What do you think each
        punctuation mark is doing?                                                
                                                                                  
                                                                                  
                                                                                  
                                                                                  
      Tiny Arcade Challenge                                               75
