π
Browse files
app.py
CHANGED
@@ -4,7 +4,10 @@ def text_to_brainfck(text):
|
|
4 |
brainfuck_code = ""
|
5 |
for char in text:
|
6 |
ascii_value = ord(char)
|
7 |
-
|
|
|
|
|
|
|
8 |
return brainfuck_code
|
9 |
|
10 |
with gr.Blocks() as demo:
|
|
|
4 |
brainfuck_code = ""
|
5 |
for char in text:
|
6 |
ascii_value = ord(char)
|
7 |
+
# Add '[' and ']' for loops
|
8 |
+
if ascii_value > 0:
|
9 |
+
brainfuck_code += "[" + "+" * ascii_value + "]"
|
10 |
+
brainfuck_code += "."
|
11 |
return brainfuck_code
|
12 |
|
13 |
with gr.Blocks() as demo:
|