You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the generated Python commands in the Python Den's Blockly with Python levels need to be changed to be more consistent. This task is to make the following changes:
instead of .is_road("FORWARD"), the generated Python should be .is_road_forward() - similarly for the other directions
instead of .is_traffic_light("RED"), the generated Python should be .is_red_traffic_light() - similarly for green
generated while loops should not put the condition in parentheses
You can see the while loop's condition is enclosed in parentheses - no need for this. It should just say while count < 4:.
You can the if condition reads my_van.is_road('FORWARD') (same for the other conditions if you change the block). Instead it should be my_van.is_road_forward() to stay consistent with what the teaching materials and the commands popup use.
There are no Python Den levels that contain traffic lights but you could see the generated Python for the traffic lights block locally if you create a custom Blocky with Python level which has the traffic light condition block enabled. You can do this in the Level Editor - It is for Rapid Router but you can still create Python levels there - bear in mind the level will appear in the Rapid Router page.
Task Description and Acceptance Criteria
Some of the generated Python commands in the Python Den's Blockly with Python levels need to be changed to be more consistent. This task is to make the following changes:
.is_road("FORWARD")
, the generated Python should be.is_road_forward()
- similarly for the other directions.is_traffic_light("RED")
, the generated Python should be.is_red_traffic_light()
- similarly for greenwhile
loops should not put the condition in parenthesesFurther details:
while
loop's condition is enclosed in parentheses - no need for this. It should just saywhile count < 4:
.my_van.is_road('FORWARD')
(same for the other conditions if you change the block). Instead it should bemy_van.is_road_forward()
to stay consistent with what the teaching materials and the commands popup use.There are no Python Den levels that contain traffic lights but you could see the generated Python for the traffic lights block locally if you create a custom Blocky with Python level which has the traffic light condition block enabled. You can do this in the Level Editor - It is for Rapid Router but you can still create Python levels there - bear in mind the level will appear in the Rapid Router page.
Good places to start
Python generation code for Blockly with Python levels: https://github.com/ocadotechnology/rapid-router/blob/8b28179b9cfecd2db8d51ac4b2671a78130a24d5/game/static/game/js/blocklyCustomBlocks.js
The text was updated successfully, but these errors were encountered: