Assignment OperatorsText:a <- expressionBlock:( a <- expression )Evaluates expression and assigns the result tothe variable a.
Display OperatorsText:DISPLAY(expression)Block:(DISPLAY expression )Displays the value of expression, followed by aspace
Input Operators
Text: INPUT()
Accepts a value from the user and returns it.
Numeric ProceduresText:RANDOM(a, b)integer from a to b, including a and b.
Evaluates to a random
Relational and Boolean Operators:The relational operators =, ≠ , ≥ ,≤ ,>and <. are used to test the relationshipbetween two variables expressionsor values
Boolean Tables:
not
and
or
terminate:son vermek
To prevent the robot from moving off the grid and resulting in an error,use the CAN_MOVE(direction) abstraction.
If the robot attempts to move to a square that is not open or is beyond the edge ofthe grid, the robot will stay in its current location, and the program will terminate
MOVE_FORWARD ():The robot moves one square forward inthe direction it is facing.ROTATE_LEFT():The robot rotates in place 90 degreescounterclockwise (i.e., makes an in-placeleftturn).
ROTATE_RIGHT ( ):The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn).
CAN_MOVE(direction):Evaluates to "true" if there is an opensquare one square in the direction relative to where the robot is facing; otherwise evaluates to "false". The value of direction can be left, right, forward or backward.
REPEAT_UNTIL Loop:Loops will repeat a section of code until a condition is met.
grid: sistem
The procedure Goal_Reached( ) , returns "true" if the robot is in the intended place and returns "false" otherwise.
# Using a temporary variable(how to swap the values of two variables)
a = 5
b = 10
temp = a
a = b
b = temp
print("a =", a)
print("b =", b)
Linear Search:A linear search (or sequential search) is an algorithm for finding anelement in a list. This search starts from the beginning of a list and sequentially checks each element of the list until a match is found or the entire list is searched without finding the element. A linear search can be used for either a sorted list or an unsorted list.If a list has n elements, the worst case for the number of searcheswould be n.
Binary Search:A binary search is a search algorithm that halves the number of elements that need to be searched after every comparison. To use a binary search ,the list must be sorted. This search compares the middle element of the list to the target value. If they are not equal, the half in which the target cannot lie is eliminated.
Pseudocode resembles a simple programming language. It is a detailed yet readable description of what a computer program or algorithm should do.