-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4127c6c
commit 2655046
Showing
69 changed files
with
1,112 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
FILE *A_fil = fopen("Instrc_r1.txt", "r"); | ||
FILE *B_fil = fopen("Instrc_r2.txt", "r"); | ||
FILE *Type_fil = fopen("Instrc_r3.txt", "r"); | ||
FILE *O_fil = fopen("Instrc_s.txt", "w"); | ||
|
||
char A_char[5]; | ||
char B_char[5]; | ||
char Type_char[5]; | ||
char O_char[5]; | ||
|
||
double A_Float; | ||
double B_Float; | ||
double O_Float; | ||
|
||
fgets(Type_char, 4, Type_fil); | ||
|
||
if (strcmp(Type_char, "IF=") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
} | ||
if (strcmp(Type_char, "IF!") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
} | ||
if (strcmp(Type_char, "A") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float + B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "S") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float - B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "M") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float * B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "D") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float / B_Float), 4, O_char); | ||
} | ||
fprintf(O_fil, "%s",O_char); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.apple.xcode.dsym.Instance</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>dSYM</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IF= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
cd Comp1 | ||
gcc -Ofast -g Instance.c -o Instance | ||
|
||
|
||
while true | ||
do | ||
./Instance | ||
#python3 Instance.py | ||
done |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
FILE *A_fil = fopen("Instrc_r1.txt", "r"); | ||
FILE *B_fil = fopen("Instrc_r2.txt", "r"); | ||
FILE *Type_fil = fopen("Instrc_r3.txt", "r"); | ||
FILE *O_fil = fopen("Instrc_s.txt", "w"); | ||
|
||
char A_char[5]; | ||
char B_char[5]; | ||
char Type_char[5]; | ||
char O_char[5]; | ||
|
||
double A_Float; | ||
double B_Float; | ||
double O_Float; | ||
|
||
fgets(Type_char, 4, Type_fil); | ||
|
||
if (strcmp(Type_char, "IF=") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
} | ||
if (strcmp(Type_char, "IF!") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
} | ||
if (strcmp(Type_char, "A") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float + B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "S") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float - B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "M") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float * B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "D") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float / B_Float), 4, O_char); | ||
} | ||
fprintf(O_fil, "%s",O_char); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.apple.xcode.dsym.Instance</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>dSYM</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
wC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IF= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
cd Comp2 | ||
gcc -Ofast -g Instance.c -o Instance | ||
|
||
|
||
while true | ||
do | ||
./Instance | ||
#python3 Instance.py | ||
done |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
FILE *A_fil = fopen("Instrc_r1.txt", "r"); | ||
FILE *B_fil = fopen("Instrc_r2.txt", "r"); | ||
FILE *Type_fil = fopen("Instrc_r3.txt", "r"); | ||
FILE *O_fil = fopen("Instrc_s.txt", "w"); | ||
|
||
char A_char[5]; | ||
char B_char[5]; | ||
char Type_char[5]; | ||
char O_char[5]; | ||
|
||
double A_Float; | ||
double B_Float; | ||
double O_Float; | ||
|
||
fgets(Type_char, 4, Type_fil); | ||
|
||
if (strcmp(Type_char, "IF=") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
} | ||
if (strcmp(Type_char, "IF!") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
if (strcmp(A_char, B_char) == 0) | ||
{ | ||
strcpy(O_char, "F"); | ||
} | ||
else | ||
{ | ||
strcpy(O_char, "T"); | ||
} | ||
} | ||
if (strcmp(Type_char, "A") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float + B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "S") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float - B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "M") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float * B_Float), 4, O_char); | ||
} | ||
if (strcmp(Type_char, "D") == 0) | ||
{ | ||
fgets(A_char, 4, A_fil); | ||
fgets(B_char, 4, B_fil); | ||
|
||
A_Float = atof(A_char); | ||
B_Float = atof(B_char); | ||
|
||
gcvt((A_Float / B_Float), 4, O_char); | ||
} | ||
fprintf(O_fil, "%s",O_char); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.