Skip to content

Commit

Permalink
modified first 5 student_code tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ishan-monie committed Jun 19, 2024
1 parent 1c66e4b commit 58d70f0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
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)

0 comments on commit 58d70f0

Please sign in to comment.