This is the basic syntax for the DSL which is being designed for Learnbot.
Indentation is not required, it is done here only for clarity.
When this code is translated into python, indentation is done automatically.
print “<statement>”
print “Learnbot DSL”
<Variable_name> = <value>
a= 55
b="hello"
if <condition> then
<statement1>
<statement2>
...
else if <condition> then
<statement1>
<statement2>
...
else
<statement1>
<statement2>
...
end
if alpha>beta then
print "Alpha wins"
else if alpha == beta then
print "Draw"
else if beta>alpha then
print "Beta wins"
else
print "Else is working"
end
<variable_name>= <Mathematical_expression>
gamma = alpha*beta - (alpha+beta)
repeat <number_of_times> times
<statement1>
<statement2>
...
end
repeat 10 times
move_left 2
end
repeat <var_name> from <rangle_low> to <range_high>
<statement1>
<statement2>
...
end
repeat i from 1 to 5
print 5*i
set_move 5*i 0
end
<var_name>= input
x = input
turn_right
turn_left
turn_back
turn <angle_in_degrees>
move_left
move_left <time_in_seconds>
move_right
move_right <time_in_seconds>
move_straight
move_straight <time_in_seconds>
stop_bot
set_move <speed> <angular_speed>
<var_name>= get_image
<var_name>= get_distance
<var_name>= get_move