-
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
2c6af14
commit f546e9e
Showing
74 changed files
with
1,272 additions
and
0 deletions.
There are no files selected for viewing
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,52 @@ | ||
from time import sleep | ||
|
||
while True: | ||
if open("Instrc_n.txt", 'r').read() == "n": | ||
|
||
sleep(0.1) | ||
|
||
fil1 = open("Instrc_r.txt", "r").read() | ||
fil2 = open("Instrc_s.txt", "w") | ||
fil2.write("P") | ||
fil2.close() | ||
fil2 = open("Instrc_s.txt", "w") | ||
print(fil1) | ||
fil1 = fil1.split(" ") | ||
print(fil1) | ||
A = fil1[0] | ||
B = fil1[1] | ||
Type = fil1[2] | ||
|
||
|
||
if Type == "A": | ||
Out = float(A)+float(B) | ||
if Type == "S": | ||
Out = float(A)-float(B) | ||
if Type == "M": | ||
Out = float(A)*float(B) | ||
if Type == "D": | ||
Out = float(A)/float(B) | ||
if Type == "IF=": | ||
print(A) | ||
print(B) | ||
if A == B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
if Type == "IF!": | ||
if A == B: | ||
Out = "F" | ||
else: | ||
Out = "T" | ||
if Type == "IF>": | ||
if A > B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
if Type == "IF<": | ||
if A < B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
fil2.write(str(Out)) | ||
fil2.close() |
Empty file.
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 @@ | ||
! 123 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,7 @@ | ||
@ECHO OFF | ||
|
||
W: | ||
cd Code | ||
python3 ./Comp1/Instance.py | ||
|
||
PAUSE |
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 @@ | ||
python3 Instance.py |
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,87 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
int main() { | ||
while (1) { | ||
FILE *file; | ||
file = fopen("Instrc_n.txt", "r"); | ||
char content[10]; | ||
fgets(content, 10, file); | ||
|
||
if (strcmp(content, "n\n") == 0) { | ||
fclose(file); | ||
usleep(100000); | ||
|
||
FILE *fil1, *fil2; | ||
fil1 = fopen("Instrc_r.txt", "r"); | ||
fil2 = fopen("Instrc_s.txt", "w"); | ||
|
||
char str[100], *token; | ||
fgets(str, 100, fil1); | ||
|
||
token = strtok(str, "!!!!!!!"); | ||
float A = atof(token); | ||
token = strtok(NULL, "!!!!!!!"); | ||
float B = atof(token); | ||
token = strtok(NULL, "!!!!!!!"); | ||
char *Type = token; | ||
|
||
float Out; | ||
if (strcmp(Type, "A") == 0) { | ||
Out = A + B; | ||
} | ||
else if (strcmp(Type, "S") == 0) { | ||
Out = A - B; | ||
} | ||
else if (strcmp(Type, "M") == 0) { | ||
Out = A * B; | ||
} | ||
else if (strcmp(Type, "D") == 0) { | ||
Out = A / B; | ||
} | ||
else if (strcmp(Type, "IF=") == 0) { | ||
if (A == B) { | ||
Out = 'T'; | ||
} | ||
else { | ||
Out = 'F'; | ||
} | ||
} | ||
else if (strcmp(Type, "IF!") == 0) { | ||
if (A == B) { | ||
Out = 'F'; | ||
} | ||
else { | ||
Out = 'T'; | ||
} | ||
} | ||
else if (strcmp(Type, "IF>") == 0) { | ||
if (A > B) { | ||
Out = 'T'; | ||
} | ||
else { | ||
Out = 'F'; | ||
} | ||
} | ||
else if (strcmp(Type, "IF<") == 0) { | ||
if (A < B) { | ||
Out = 'T'; | ||
} | ||
else { | ||
Out = 'F'; | ||
} | ||
} | ||
char Out1[6]; | ||
gcvt(Out, 6, Out1); | ||
fprintf(fil2, "%s", Out1); | ||
fclose(fil1); | ||
fclose(fil2); | ||
} | ||
else { | ||
fclose(file); | ||
} | ||
} | ||
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,53 @@ | ||
from time import sleep | ||
|
||
while True: | ||
if open("Instrc_n.txt", 'r').read() == "n": | ||
|
||
sleep(0.1) | ||
|
||
fil1 = open("Instrc_r.txt", "r").read() | ||
fil2 = open("Instrc_s.txt", "w") | ||
fil2.write("P") | ||
fil2.close() | ||
fil2 = open("Instrc_s.txt", "w") | ||
print(fil1) | ||
fil1 = fil1.split(" ") | ||
#fil1 = fil1.split("| "+r"\n*\n"+" |") | ||
print(fil1) | ||
A = fil1[0] | ||
B = fil1[1] | ||
Type = fil1[2] | ||
|
||
|
||
if Type == "A": | ||
Out = float(A)+float(B) | ||
if Type == "S": | ||
Out = float(A)-float(B) | ||
if Type == "M": | ||
Out = float(A)*float(B) | ||
if Type == "D": | ||
Out = float(A)/float(B) | ||
if Type == "IF=": | ||
print(A) | ||
print(B) | ||
if A == B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
if Type == "IF!": | ||
if A == B: | ||
Out = "F" | ||
else: | ||
Out = "T" | ||
if Type == "IF>": | ||
if A > B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
if Type == "IF<": | ||
if A < B: | ||
Out = "T" | ||
else: | ||
Out = "F" | ||
fil2.write(str(Out)) | ||
fil2.close() |
Empty file.
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 @@ | ||
p! 123 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,4 @@ | ||
@ECHO OFF | ||
|
||
cd W:/Code/Orchid/Code/ | ||
W:/Code/python.exe W:/Code/Orchid/Code/Comp2/Instance.py |
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 @@ | ||
python3 Instance.py |
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,89 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
int main() { | ||
while (1) { | ||
FILE *file; | ||
file = fopen("Instrc_n.txt", "r"); | ||
char content[10]; | ||
fgets(content, 10, file); | ||
|
||
if (strcmp(content, "n\n") == 0) { | ||
fclose(file); | ||
usleep(100000); | ||
|
||
FILE *fil1, *fil2; | ||
fil1 = fopen("Instrc_r.txt", "r"); | ||
fil2 = fopen("Instrc_s.txt", "w"); | ||
|
||
char str[100], *token; | ||
fgets(str, 100, fil1); | ||
|
||
token = strtok(str, "!!!!!!!"); | ||
float A = atof(token); | ||
token = strtok(NULL, "!!!!!!!"); | ||
float B = atof(token); | ||
token = strtok(NULL, "!!!!!!!"); | ||
char *Type = token; | ||
|
||
int Out; | ||
if (strcmp(Type, "A") == 0) { | ||
Out = A + B; | ||
} | ||
else if (strcmp(Type, "S") == 0) { | ||
Out = A - B; | ||
} | ||
else if (strcmp(Type, "M") == 0) { | ||
Out = A * B; | ||
} | ||
else if (strcmp(Type, "D") == 0) { | ||
Out = A / B; | ||
} | ||
char Out2; | ||
if (strcmp(Type, "IF=") == 0) { | ||
if (A == B) { | ||
Out2 = "T"; | ||
} | ||
else { | ||
Out2 = "F"; | ||
} | ||
} | ||
else if (strcmp(Type, "IF!") == 0) { | ||
if (A == B) { | ||
Out2 = "F"; | ||
} | ||
else { | ||
Out2 = "T"; | ||
} | ||
} | ||
else if (strcmp(Type, "IF>") == 0) { | ||
if (A > B) { | ||
Out2 = "T"; | ||
} | ||
else { | ||
Out2 = "F"; | ||
} | ||
} | ||
else if (strcmp(Type, "IF<") == 0) { | ||
if (A < B) { | ||
Out2 = "T"; | ||
} | ||
else { | ||
Out2 = "F"; | ||
} | ||
} | ||
char Out1[6]; | ||
gcvt(Out, 6, Out1); | ||
fprintf(fil2, "%s", Out1); | ||
fprintf(fil2, "%c", Out2); | ||
fclose(fil1); | ||
fclose(fil2); | ||
} | ||
else { | ||
fclose(file); | ||
} | ||
} | ||
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.
Oops, something went wrong.