minError

PlayGrounds [ 포털 켜기 및 끄기 ] 본문

PlayGround/코딩배우기 2

PlayGrounds [ 포털 켜기 및 끄기 ]

동빠기 2020. 3. 4. 00:22

 

 

purplePortal.isActive = true

    while !isBlocked {
    
        moveForward()
        
        while isOnGem {
        
            collectGem()
            
            if isBlocked {
            
                turnLeft()
                
                turnLeft()
                
                purplePortal.isActive = false
                
            }
            
        }
        
        if isOnClosedSwitch {
        
            toggleSwitch()
            
            purplePortal.isActive = true
            
            turnLeft()
            
            turnLeft()
            
        }
        
    }
Comments