Default a8
This commit is contained in:
parent
5f01274dc4
commit
b760363dc9
34
Assignment8/code/template.c
Normal file
34
Assignment8/code/template.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
char currentDirection;
|
||||||
|
|
||||||
|
void fcfs(int start){
|
||||||
|
int movement = 0;
|
||||||
|
double time = 0;
|
||||||
|
printf("Movement: %i Time:%.1lf\n", movement, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cscan(int start){
|
||||||
|
int movement = 0;
|
||||||
|
double time = 0;
|
||||||
|
printf("Movement: %i Time:%.1lf\n", movement, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main (int argc, char** argv){
|
||||||
|
int position, time;
|
||||||
|
char algorithm = argv[1][0];
|
||||||
|
int start = 0;
|
||||||
|
currentDirection = 'a';
|
||||||
|
|
||||||
|
|
||||||
|
while ( EOF!=(scanf("%i %i\n",&position,&time)))
|
||||||
|
{
|
||||||
|
printf("Delete me: position %i, Delete me: time %i\n",position,time);
|
||||||
|
}
|
||||||
|
if (algorithm == 'F'){
|
||||||
|
fcfs(start);
|
||||||
|
}else if ( algorithm == 'C'){
|
||||||
|
cscan(start);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
8
Assignment8/in/all_known_in_advance_spaces.in
Normal file
8
Assignment8/in/all_known_in_advance_spaces.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
93 0
|
||||||
|
183 0
|
||||||
|
37 0
|
||||||
|
122 0
|
||||||
|
14 0
|
||||||
|
124 0
|
||||||
|
65 0
|
||||||
|
67 0
|
14
Assignment8/in/time_dependent_second_spaces.in
Normal file
14
Assignment8/in/time_dependent_second_spaces.in
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
7394 61
|
||||||
|
1217 63
|
||||||
|
3898 70
|
||||||
|
4254 74
|
||||||
|
8951 75
|
||||||
|
4764 86
|
||||||
|
5517 95
|
||||||
|
6765 100
|
||||||
|
151 108
|
||||||
|
5637 121
|
||||||
|
4245 125
|
||||||
|
8742 130
|
||||||
|
1703 138
|
||||||
|
879 140
|
8
Assignment8/in/time_dependent_spaces.in
Normal file
8
Assignment8/in/time_dependent_spaces.in
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
93 10
|
||||||
|
183 12
|
||||||
|
37 15
|
||||||
|
122 17
|
||||||
|
14 18
|
||||||
|
124 20
|
||||||
|
65 23
|
||||||
|
67 25
|
15
Assignment8/makefile
Normal file
15
Assignment8/makefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
all:
|
||||||
|
gcc -g -O0 ./code/*.c -lm
|
||||||
|
1:
|
||||||
|
./a.out F < in/all_known_in_advance_spaces.in > student_out/f-in-advance.out && diff student_out/f-in-advance.out out/f-in-advance.out
|
||||||
|
2:
|
||||||
|
./a.out C < in/all_known_in_advance_spaces.in > student_out/c-in-advance.out && diff student_out/c-in-advance.out out/c-in-advance.out
|
||||||
|
3:
|
||||||
|
./a.out F < in/time_dependent_spaces.in > student_out/f-time_dependent.out && diff student_out/f-time_dependent.out out/f-time_dependent.out
|
||||||
|
4:
|
||||||
|
./a.out C < in/time_dependent_spaces.in > student_out/c-time_dependent.out && diff student_out/c-time_dependent.out out/c-time_dependent.out
|
||||||
|
5:
|
||||||
|
./a.out F < in/time_dependent_second_spaces.in > student_out/f-time_dependent_second.out && diff student_out/f-time_dependent_second.out out/f-time_dependent_second.out
|
||||||
|
6:
|
||||||
|
./a.out C < in/time_dependent_second_spaces.in > student_out/c-time_dependent_second.out && diff student_out/c-time_dependent_second.out out/c-time_dependent_second.out
|
||||||
|
|
1
Assignment8/out/c-in-advance.out
Normal file
1
Assignment8/out/c-in-advance.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement: 183 Time:36.6
|
1
Assignment8/out/c-time_dependent.out
Normal file
1
Assignment8/out/c-time_dependent.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement: 10067 Time:2023.4
|
1
Assignment8/out/c-time_dependent_second.out
Normal file
1
Assignment8/out/c-time_dependent_second.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement: 16765 Time:3414.0
|
1
Assignment8/out/f-in-advance.out
Normal file
1
Assignment8/out/f-in-advance.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement:693 Time:228.6
|
1
Assignment8/out/f-time_dependent.out
Normal file
1
Assignment8/out/f-time_dependent.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement:693 Time:238.6
|
1
Assignment8/out/f-time_dependent_second.out
Normal file
1
Assignment8/out/f-time_dependent_second.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Movement:53345 Time:10865.0
|
Loading…
Reference in New Issue
Block a user