t = codesters.Teacher()
try:
tval1 = t.find_text('+=')[0][1]
tval2 = t.find_text('+=')[0][0]
tval2 = t.get_indent_at_line(tval2)
except:
tval1 = "DNE"
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1.replace(' ', '') == 'left_count+=1' and tval2 == 4, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add an Add Value command to your Left Key event?")
t1.add_failure('left_count' not in tval1, "Make sure you change the name of the variable in the Add Value command to left_count.")
t1.add_failure('1' not in tval1, "Make sure the value that you;re adding to the variable is 1.")
t1.add_failure(tval2 < 4, "Make sure your Add Value command is indented 4 spaces inside you Left Key event.")
t1.add_failure(tval2 > 4, "Oops! You indented too far. Make sure your Add Value command is only 4 spaces inside your Left Key event.")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Try the following steps to connect to your Micro:bit:
1. You may need to reload this page and try your program again.
2. Try disconnecting and reconnecting your Micro:bit. Then reload the page and run your program again.
3. If you are still having problems your Micro:bit may have an old
firmware version that is incompatible with Codesters.
To update the firmware follow these instructions from Micro:bit
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.