Code | Points | Description |
---|---|---|
A1 | 2 | Submission is zip containing nbody folder with python files |
A2 | 2 | Zip is named after uni, unzips to folder with uni-hw5 |
A3 | 3 | Python files have correct names/imports |
A4 | 3 | Python files have good style |
Code | Points | Description |
---|---|---|
B1 | 2 | Test case 1 |
B2 | 2 | Test case 2 |
B3 | 2 | Test case 3 |
B4 | 2 | Test case 4 |
B5 | 2 | Test case 5 |
B6 | 2 | Test case 6 |
B7 | 2 | Test case 7 |
B8 | 2 | Test case 8 |
B9 | 2 | Test case 9 |
B10 | 2 | Test case 10 |
B11 | 2 | Function is in the proper file, proper name |
B12 | 2 | Good Style (No globals, comments, well named vars) |
Test Cases:
exp2(0)
-> 1
exp2(1)
-> 2
exp2(4)
-> 16
isPalindrome("")
-> True
isPalindrome("a")
-> True
isPalindrome("aa")
-> True
isPalindrome("ab")
-> False
isPalindrome("aba")
-> True
isPalindrome("abcba")
-> True
isPalindrome("abcbb")
-> False
Code | Points | Description |
---|---|---|
C1 | 4 | Code returns x and y position as floats (either tuple, list, or array) |
C2 | 6 | Test case 1 |
C3 | 6 | Test case 2 |
C4 | 6 | Test case 3 |
C5 | 6 | Test case 4 |
C6 | 2 | Function is in the proper file, proper name |
C7 | 3 | Good Style (No globals, comments, well named vars) |
Note: Small differences are fine due to floating point error
Test Cases:
centerOfMass(np.array([[0, 0, 1]]))
-> 0.0, 0.0
centerOfMass(np.array([[0, 0, 1], [0, 0, 1]]))
-> 0.0, 0.0
centerOfMass(np.array([[0, 0, 1], [0, 1, 1]]))
-> 0.0, 0.5
centerOfMass(np.array([[0, 0, 10], [0, 10, 10], [10, 0, 10], [10, 10, 10]]))
-> 5.0, 5.0
Code | Points | Description |
---|---|---|
D1 | 4 | Code takes array/list of N 5x1 objects and returns corresponding array/list of N 2x1 forces |
D2 | 6 | Test case 1 |
D3 | 6 | Test case 2 |
D4 | 6 | Test case 3 |
D5 | 6 | Test case 4 |
D6 | 2 | Function is in the proper file, proper name |
D7 | 3 | Good Style (No globals, comments, well named vars) |
Note: Small differences are fine due to floating point error
Test Cases:
sumOfForces([])
-> []
sumOfForces([[0, 0, 100, 0, 0]])
-> [[0, 0]]
sumOfForces([[0, 0, 1935, 0, 0], [3, 4, 1936, 0, 0]])
-> [[6.0, 8.0], [-6.0, -8.0]]
sumOfForces([[0, 0, 1935, 0, 0], [3, 4, 1936, 0, 0], [-3, -4, 1936, 0, 0]])
[[0.0*, 0.0*], [-9.0, -12.0], [9.0, 12.0]]
(0.0
or very very small due to floating point error)[[0.0*, 0.0*], [-7.5, -10.0], [7.5, 10.0]]
(0.0
or very very small due to floating point error)