Skip to content

Commit 7b73c6c

Browse files
author
tianqi77
committed
add system tests for iteration 3
1 parent b827a77 commit 7b73c6c

27 files changed

+17017
-190
lines changed

Team20/Tests20/iteration1/system_test_1_queries.txt

+435
Large diffs are not rendered by default.

Team20/Tests20/iteration3/Affects/affects_1_queries.txt

+575
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
procedure foo {
2+
read x;
3+
read y;
4+
length = x * x + y * y;
5+
t = 30;
6+
call bar;
7+
print length;
8+
}
9+
10+
procedure bar {
11+
if ((x >= 0) && (y >= 0)) then {
12+
while (x != 0) {
13+
tan = y / x;
14+
sin = y / length;
15+
cos = x / length;
16+
call ellipse;
17+
if (((sin * sin + cos * cos) == 1) || (!(tan != (sin / cos)))) then {
18+
x = y / 2;
19+
y = x / 2;
20+
} else {
21+
x = 0;
22+
}
23+
length = x * x + y * y;
24+
}
25+
} else {
26+
x = 10;
27+
y = 10;
28+
length = x * x + y * y;
29+
}
30+
}
31+
32+
procedure ellipse {
33+
pi = 3;
34+
area = pi * x * y;
35+
if (area < 10) then {
36+
x = x + 1;
37+
y = y + y / x + 1;
38+
} else {
39+
print area;
40+
}
41+
}

Team20/Tests20/iteration3/Affects/affects_2_queries.txt

+575
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
procedure One {
2+
read i;
3+
if (i <= 0) then {
4+
i = 10;
5+
} else {
6+
i = i;
7+
}
8+
while (i >= 0) {
9+
read x;
10+
read y;
11+
read distance;
12+
k = 0;
13+
read x1;
14+
read y1;
15+
difference =
16+
(x - x1) * (x - x1) + (y - y1) * (y - y1) - distance * distance;
17+
if (difference > 0) then {
18+
print x1;
19+
print y1;
20+
} else {
21+
while (difference <= 0) {
22+
read x1;
23+
read y1;
24+
difference =
25+
(x - x1) * (x - x1) + (y - y1) * (y - y1) - distance * distance;
26+
k = k + 1;
27+
}
28+
print k;
29+
print x1;
30+
print y1;
31+
}
32+
i = i - 1;
33+
call Two;
34+
}
35+
}
36+
37+
procedure Two {
38+
if (x1 < x) then {
39+
if (y1 < y) then {
40+
i = i + 1;
41+
} else {
42+
i = i + 1;
43+
}
44+
} else {
45+
if (y1 < y) then {
46+
i = i + 1;
47+
} else {
48+
i = i;
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)