Bug Algorithm in Tetrix Prizm

How do you implement code for Bug 0 Algorithm in Tetrix Prizm robot with one ultrasonic sensor?