Skip to content

Commit cfe957c

Browse files
committed
changed '69.bf' to 'hi.bf'
1 parent 4738341 commit cfe957c

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Why i did it? Because I was bored. Why does this language exists in the first pl
3636

3737
# AUTHOR NOTE
3838

39-
Hope you enjoy playing with this, it's possible to do some impressive stuff. Remember that is under the GPLv3, that means that if you improve the design and don't push it to the repo, you owe me your first born child.
39+
Hope you enjoy playing with this, it's possible to do some impressive stuff.

main.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44

55
#define LENGTH 9999
66

7+
/*
8+
* How does brainfuck work?
9+
* + -> changes the value of the cell by 1
10+
* - -> changes the value of the cell by -1
11+
* > -> changes the cell by 1
12+
* < -> changes the cell by -1
13+
* . -> prints the int value of the cell
14+
* : -> prints the ascii value of the cell
15+
* , -> accepts int input and adds it to the cell
16+
* ; -> gets the ascii input and adds its number to the cell
17+
* [] -> loops if the value of the cell it ends on isn't 0
18+
*/
19+
720
int main(int argc, char *argv[]){
821

922
// Check if all the needed arguments are provided
@@ -12,14 +25,14 @@ int main(int argc, char *argv[]){
1225
return 1;
1326
}
1427

15-
// Get the source code from the file provided
16-
char source[LENGTH];
17-
strcpy(source, "");
18-
FILE *file;
19-
file=fopen(argv[1], "r");
20-
fgets(source, LENGTH, file);
21-
fclose(file);
28+
// Get the source code from the file provided and print it
29+
char source[LENGTH]="";
30+
fgets(source, LENGTH, fopen(argv[1], "r"));
31+
printf("Source code: %s\n", source);
2232

33+
// Interpreter
34+
int cells[LENGTH], pos, loops[];
35+
for (int i=0; i=)
2336

24-
printf("Source code: %s\n", source);
37+
return 0;
2538
}

test/69.bf

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/hi.bf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

0 commit comments

Comments
 (0)