Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified first 5 student_code tests #278

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/student_code/executor_sanity.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''
import time
import math

Expand All @@ -23,3 +24,26 @@ def teleop_setup():

def teleop_main():
oops = 1 / 0
'''

import time
import math

# This autonomous code prints some output every two seconds

def constant_print(msg):
while True:
print(f"{msg} printing again")
time.sleep(2)

def autonomous():
print('Autonomous has begun!')
print(f"Starting position: {Robot.start_pos}")
while True:
Robot.run(constant_print, "autonomous")

# This teleop code generates a DivisionByZero Python error

def teleop():
while True:
oops = 1 / 0
17 changes: 16 additions & 1 deletion tests/student_code/keyboard_input.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

'''
simple_device = "62_20"

def autonomous_setup():
Expand All @@ -16,3 +16,18 @@ def teleop_main():
elif Keyboard.get_value('y'):
print(Robot.get_value(simple_device, "MY_INT"))
Robot.sleep(.45)
'''

simple_device = "62_20"

def autonomous():
while True:
pass

def teleop():
while True:
if Keyboard.get_value('a'):
Robot.set_value(simple_device, "MY_INT", 123454321)
elif Keyboard.get_value('y'):
print(Robot.get_value(simple_device, "MY_INT"))
Robot.sleep(0.45)
Loading