feat: add open file logic
This commit is contained in:
18
dopey.py
18
dopey.py
@@ -1,3 +1,4 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
# create memory buffer
|
# create memory buffer
|
||||||
BUFFER_SIZE = 30_000
|
BUFFER_SIZE = 30_000
|
||||||
@@ -11,4 +12,19 @@ DECREMENT = "-"
|
|||||||
OUTPUT = "."
|
OUTPUT = "."
|
||||||
INPUT = ","
|
INPUT = ","
|
||||||
OPEN_LOOP = "["
|
OPEN_LOOP = "["
|
||||||
CLOSE_LOOP = "]"
|
CLOSE_LOOP = "]"
|
||||||
|
|
||||||
|
# get bf file location
|
||||||
|
file_location = None
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print("Invalid or missing arguments...")
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
file_location = sys.argv[1]
|
||||||
|
|
||||||
|
# open file
|
||||||
|
file = open(file_location, "r")
|
||||||
|
print(file.read(1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
helloworld.bf
Normal file
2
helloworld.bf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>
|
||||||
|
---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
|
||||||
Reference in New Issue
Block a user