Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Pseudo code
1. BASIC
PSEUDOCODE
START PROGRAM
IMPORT tkinter
IMPORT time
SET timer
DISPLAY obstacle shapes
DISPLAY robot
DETERMINE robot route
WHILE time is less than 500
LOOP robot route
END WHILE
END PROGRAM
INTERMEDIATE
PSEUDOCODE
START PROGRAM
IMPORT tkinter
IMPORT time
IMPORT random
SET timer
DISPLAY obstacle shapes
DISPLAY robot
DISPLAY green traffic lights
DETERMINE robot route 1
DETERMINE robot route 2
DETERMINE robot route 3
SET a random number between 1 and 3
DISPLAY route from random number
FOR traffic light
IF traffic light equals 5
SET traffic light colour to red
ELSE IF traffic light equals 10
SET traffic light colour to green
SET traffic light to 0
ELSE
INCREMENT by 1
END IF
END FOR
2. WHILE time is less than 500
LOOP robot route
WHILE traffic light is red
SET robot to pause
END WHILE
END WHILE
END PROGRAM
ADVANCED
PSEUDOCODE
START PROGRAM
IMPORT tkinter
IMPORT time
IMPORT random
SET timer
DISPLAY obstacle shapes
DISPLAY robot
DISPLAY robot2
DISPLAY green traffic lights
DETERMINE random robot route
(DETERMINE random robot2 route
IF robot NEAR obstacle shapes
robot rebounds
ENDIF
IF robot NEAR robot2
robot MOVE_AWAY robot2
ENDIF)
IF robot2 NEAR obstacle shapes
robot2 rebounds
ENDIF
IF robot2 NEAR robot
robot2 MOVE_AWAY robot
ENDIF
FOR traffic light
IF traffic light equals 5
SET traffic light colour to red
ELSE IF traffic light equals 10
SET traffic light colour to green
SET traffic light to 0
ELSE
INCREMENT by 1
END IF
END FOR
3. WHILE time is less than 500
LOOP robot route
(LOOP robot2 route)
WHILE traffic light is red
SET robot to pause
(SET robot2 to pause)
END WHILE
END WHILE
END PROGRAM