-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_functions.py
57 lines (47 loc) · 1007 Bytes
/
test_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import visupy
# The following are test functions that demonstrate how VisuPy works.
def basicFunction():
x = 2
if x == 2:
print(x)
else:
x += 2
return x
def fibonacci(n):
L = []
for i in range(n):
if len(L) == 0 or len(L) == 1:
L.append(1)
else:
a = L[i-1]
b = L[i-2]
L.append(a + b)
return L
def hardFunction(x):
s = 10
u = 0
a = 10
y = 1
if x == 1:
y += 4
z = x + y
else:
y = 0
z = 0
z = z ** 2
if y == 2:
print('y is 2')
print('Code is so clear!')
for i in range(2):
print("I'm helping on line"+ str(i))
x = 4+i
x = 3
if z == -1:
print("How did that happen")
print("z is bad!")
else:
print("phew")
print('I understand my code')
visupy.visualize(basicFunction, 'basic')
visupy.visualize(fibonacci, 'fibonacci')
visupy.visualize(hardFunction, 'hard')