Skip to content

Commit b24ce7a

Browse files
author
Kenneth Apeland
committed
Merge branch 'master' of https://github.com/kennidenni/INF219
2 parents 11f7bbc + 23bdfb0 commit b24ce7a

File tree

4 files changed

+66
-88
lines changed

4 files changed

+66
-88
lines changed

Diff for: Graphs/js/graphStructureController.js

+30-42
Original file line numberDiff line numberDiff line change
@@ -70,64 +70,52 @@ function checkOverlap(x, y) {
7070
/*************************************************************** */
7171
function exampleGraphStar() {
7272
resetAll();
73-
graphUIClicked(287, 230);
7473
graphUIClicked(73, 98);
74+
graphUIClicked(287, 230);
7575
graphUIClicked(266, 49);
7676
graphUIClicked(470, 82);
7777
graphUIClicked(573, 290);
7878
graphUIClicked(472, 464);
7979
graphUIClicked(201, 485);
8080
graphUIClicked(49, 325);
81-
twoNodesClicked(0, 1);
8281
graphUIClicked(298, 227);
83-
twoNodesClicked(2, 0);
8482
graphUIClicked(281, 235);
85-
twoNodesClicked(0, 3);
86-
twoNodesClicked(0, 4);
87-
twoNodesClicked(0, 5);
88-
twoNodesClicked(6, 0);
83+
twoNodesClicked(0, 1);
84+
twoNodesClicked(2, 0);
85+
twoNodesClicked(1, 2);
86+
twoNodesClicked(1, 3);
87+
twoNodesClicked(1, 4);
88+
twoNodesClicked(1, 5);
89+
twoNodesClicked(1, 6);
90+
twoNodesClicked(1, 7);
91+
twoNodesClicked(2, 3);
92+
twoNodesClicked(3, 4);
93+
twoNodesClicked(4, 5);
94+
twoNodesClicked(5, 6);
95+
twoNodesClicked(6, 7);
8996
twoNodesClicked(7, 0);
9097
instantCollapseAll();
9198
}
9299
function exampleGraphAllConnected() {
93100
resetAll();
94-
graphUIClicked(66, 71);
95-
graphUIClicked(337, 158);
96-
graphUIClicked(571, 64);
97-
graphUIClicked(77, 278);
98-
graphUIClicked(233, 306);
99-
graphUIClicked(420, 303);
100-
graphUIClicked(437, 454);
101-
graphUIClicked(134, 437);
102-
graphUIClicked(577, 184);
101+
graphUIClicked(60, 70);
102+
graphUIClicked(350, 70);
103+
graphUIClicked(600, 70);
104+
graphUIClicked(60, 300);
105+
graphUIClicked(350, 300);
106+
graphUIClicked(600, 300);
107+
graphUIClicked(60, 500);
108+
graphUIClicked(600, 500);
103109
twoNodesClicked(0, 1);
104-
twoNodesClicked(2, 1);
105-
twoNodesClicked(2, 0);
106-
twoNodesClicked(3, 0);
110+
twoNodesClicked(1, 2);
111+
twoNodesClicked(0, 3);
107112
twoNodesClicked(0, 4);
108-
twoNodesClicked(5, 0);
109-
twoNodesClicked(7, 0);
110-
twoNodesClicked(6, 0);
111-
twoNodesClicked(3, 2);
112-
twoNodesClicked(3, 1);
113-
twoNodesClicked(4, 3);
114-
twoNodesClicked(5, 3);
115-
twoNodesClicked(7, 3);
116-
twoNodesClicked(6, 3);
113+
twoNodesClicked(4, 6);
114+
twoNodesClicked(3, 4);
115+
twoNodesClicked(2, 5);
117116
twoNodesClicked(1, 5);
118-
twoNodesClicked(4, 1);
119-
twoNodesClicked(3, 1);
120-
twoNodesClicked(7, 1);
121-
twoNodesClicked(6, 1);
122-
twoNodesClicked(5, 2);
123-
twoNodesClicked(4, 5);
124-
twoNodesClicked(7, 5);
125-
twoNodesClicked(6, 5);
126-
twoNodesClicked(6, 4);
127-
twoNodesClicked(7, 4);
128-
twoNodesClicked(2, 7);
129-
twoNodesClicked(2, 6);
130-
twoNodesClicked(7, 6);
131-
twoNodesClicked(2, 4);
117+
twoNodesClicked(1, 4);
118+
twoNodesClicked(3, 6);
119+
twoNodesClicked(4, 7);
132120
instantCollapseAll();
133121
}

Diff for: Graphs/js/graphStructureController.ts

+32-42
Original file line numberDiff line numberDiff line change
@@ -86,65 +86,55 @@ function checkOverlap(x: number, y: number) {
8686

8787
function exampleGraphStar() {
8888
resetAll();
89-
graphUIClicked(287, 230);
9089
graphUIClicked(73, 98);
90+
graphUIClicked(287, 230);
9191
graphUIClicked(266, 49);
9292
graphUIClicked(470, 82);
9393
graphUIClicked(573, 290);
9494
graphUIClicked(472, 464);
9595
graphUIClicked(201, 485);
9696
graphUIClicked(49, 325);
97-
twoNodesClicked(0, 1);
9897
graphUIClicked(298, 227);
99-
twoNodesClicked(2, 0);
10098
graphUIClicked(281, 235);
101-
twoNodesClicked(0, 3);
102-
twoNodesClicked(0, 4);
103-
twoNodesClicked(0, 5);
104-
twoNodesClicked(6, 0);
99+
100+
twoNodesClicked(0, 1);
101+
twoNodesClicked(2, 0);
102+
twoNodesClicked(1, 2);
103+
twoNodesClicked(1, 3);
104+
twoNodesClicked(1, 4);
105+
twoNodesClicked(1, 5);
106+
twoNodesClicked(1, 6);
107+
twoNodesClicked(1, 7);
108+
twoNodesClicked(2, 3);
109+
twoNodesClicked(3, 4);
110+
twoNodesClicked(4, 5);
111+
twoNodesClicked(5, 6);
112+
twoNodesClicked(6, 7);
105113
twoNodesClicked(7, 0);
106114
instantCollapseAll();
107115
}
108116

109117
function exampleGraphAllConnected() {
110118
resetAll();
111-
graphUIClicked(66, 71);
112-
graphUIClicked(337, 158);
113-
graphUIClicked(571, 64);
114-
graphUIClicked(77, 278);
115-
graphUIClicked(233, 306);
116-
graphUIClicked(420, 303);
117-
graphUIClicked(437, 454);
118-
graphUIClicked(134, 437);
119-
graphUIClicked(577, 184);
119+
graphUIClicked(60, 70);
120+
graphUIClicked(350, 70);
121+
graphUIClicked(600, 70);
122+
graphUIClicked(60, 300);
123+
graphUIClicked(350, 300);
124+
graphUIClicked(600, 300);
125+
graphUIClicked(60, 500);
126+
graphUIClicked(600, 500);
127+
120128
twoNodesClicked(0, 1);
121-
twoNodesClicked(2, 1);
122-
twoNodesClicked(2, 0);
123-
twoNodesClicked(3, 0);
129+
twoNodesClicked(1, 2);
130+
twoNodesClicked(0, 3);
124131
twoNodesClicked(0, 4);
125-
twoNodesClicked(5, 0);
126-
twoNodesClicked(7, 0);
127-
twoNodesClicked(6, 0);
128-
twoNodesClicked(3, 2);
129-
twoNodesClicked(3, 1);
130-
twoNodesClicked(4, 3);
131-
twoNodesClicked(5, 3);
132-
twoNodesClicked(7, 3);
133-
twoNodesClicked(6, 3);
132+
twoNodesClicked(4, 6);
133+
twoNodesClicked(3, 4);
134+
twoNodesClicked(2, 5);
134135
twoNodesClicked(1, 5);
135-
twoNodesClicked(4, 1);
136-
twoNodesClicked(3, 1);
137-
twoNodesClicked(7, 1);
138-
twoNodesClicked(6, 1);
139-
twoNodesClicked(5, 2);
140-
twoNodesClicked(4, 5);
141-
twoNodesClicked(7, 5);
142-
twoNodesClicked(6, 5);
143-
twoNodesClicked(6, 4);
144-
twoNodesClicked(7, 4);
145-
twoNodesClicked(2, 7);
146-
twoNodesClicked(2, 6);
147-
twoNodesClicked(7, 6);
148-
twoNodesClicked(2, 4);
136+
twoNodesClicked(1, 4);
137+
twoNodesClicked(3, 6);
138+
twoNodesClicked(4, 7);
149139
instantCollapseAll();
150140
}

Diff for: Heap/js/methods.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ function setHeaderText(text) {
298298
}
299299
function setUpAddButton() {
300300
$("#addElem").click(function () {
301-
var val = prompt("Which value do you want to add? Integer >= 0. Maximum number of elements is 10");
302-
if (isNaN(parseInt(val)) || control.getArrayLength() >= 10) {
301+
var val = prompt("Which value do you want to add? Integer in the range 0-99. Maximum number of elements is 10");
302+
if (isNaN(parseInt(val)) || control.getArrayLength() >= 10 || parseInt(val) < 0 || parseInt(val) > 99) {
303303
return;
304304
}
305305
viewer.addNode(parseInt(val));

Diff for: Heap/js/methods.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ function setHeaderText(text: string) {
342342

343343
function setUpAddButton() {
344344
$("#addElem").click(function () {
345-
let val = prompt("Which value do you want to add? Integer >= 0. Maximum number of elements is 10");
346-
if (isNaN(parseInt(val)) || control.getArrayLength() >= 10) {
345+
let val = prompt("Which value do you want to add? Integer in the range 0-99. Maximum number of elements is 10");
346+
if (isNaN(parseInt(val)) || control.getArrayLength() >= 10 || parseInt(val) < 0 || parseInt(val) > 99) {
347347
return;
348348
}
349349
viewer.addNode(parseInt(val));

0 commit comments

Comments
 (0)