course_planning:code-testing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
course_planning:code-testing [2024/01/19 13:39] caballerocourse_planning:code-testing [2024/01/19 13:44] (current) caballero
Line 91: Line 91:
  
 dt = 0.3 dt = 0.3
 +while True:
 +    rate(200)
 +    ball.pos = ball.pos + (ball.p/ball.mass)*dt
 +    if not (side > ball.pos.x > -side):
 +        ball.p.x = -ball.p.x
 +    if not (side > ball.pos.y > -side):
 +        ball.p.y = -ball.p.y
 +    if not (side > ball.pos.z > -side):
 +        ball.p.z = -ball.p.z
 +</code>
 +
 +
 +## With Line Numbers, Highlighting, Title, and ReNumbering
 +
 +### Syntax
 +
 +```
 +<code python [enable_line_numbers="true", highlight_lines_extra="ARRAY_OF_LINE_NUMBERS", start_line_numbers_at="NUMBER"] | TITLE>
 +{YOUR CODE}
 +</code>
 +```
 +
 +**Note: Highlighting lines uses an absolute number (i.e., the given number of lines sets the length and order starting from 1).**
 +
 +### Example
 +
 +<code python [enable_line_numbers="true", highlight_lines_extra="4,6,8", start_line_numbers_at="27"] | Focusing on the Loop >
 while True: while True:
     rate(200)     rate(200)
  • course_planning/code-testing.1705671575.txt.gz
  • Last modified: 2024/01/19 13:39
  • by caballero