From 02653ab40d93fb7e6d07edb747fe0e07c5d60c74 Mon Sep 17 00:00:00 2001 From: thing1 Date: Thu, 30 Jan 2025 12:49:01 +0000 Subject: did many new things --- bio/1/1 | Bin 0 -> 20288 bytes bio/1/1.c | 179 +++++++++++++++++++++ bio/1/1.c.sh | 5 + bio/1/1.txt | 5 + bio/1/Makefile | 4 + bio/1/count | 1 + bio/1/loopstr | Bin 0 -> 15544 bytes bio/1/loopstr.c | 9 ++ bio/3/3 | Bin 0 -> 17312 bytes bio/3/3.c | 27 ++++ bio/3/Makefile | 4 + comp/lucas-standen-NEA/code2/Makefile.new | 25 --- comp/lucas-standen-NEA/code2/appendsnprintf.o | Bin 2536 -> 0 bytes comp/lucas-standen-NEA/code2/code.zip | Bin 0 -> 17212 bytes comp/lucas-standen-NEA/code2/comp.o | Bin 15504 -> 0 bytes comp/lucas-standen-NEA/code2/examples/fib_example | Bin 24664 -> 0 bytes .../lucas-standen-NEA/code2/examples/spaceinvaders | Bin 21832 -> 0 bytes comp/lucas-standen-NEA/code2/examples/str_example | Bin 19704 -> 0 bytes comp/lucas-standen-NEA/code2/examples/tmp.zpy.c | 2 - comp/lucas-standen-NEA/code2/fileread.o | Bin 2008 -> 0 bytes .../lucas-standen-NEA/code2/stdlib/String/String.o | Bin 6888 -> 0 bytes comp/lucas-standen-NEA/code2/stdlib/zpylib.o | Bin 3384 -> 0 bytes comp/lucas-standen-NEA/code2/tokenizer.o | Bin 2080 -> 0 bytes comp/lucas-standen-NEA/code2/util.o | Bin 1616 -> 0 bytes comp/lucas-standen-NEA/code2/zpy | Bin 22072 -> 0 bytes comp/lucas-standen-NEA/code2/zpy.o | Bin 5040 -> 0 bytes comp/work/37/rpn | Bin 19688 -> 19664 bytes comp/work/37/stack.o | Bin 0 -> 2088 bytes comp/work/41/exersise.py | 24 +++ comp/work/41/starter.txt | 5 + comp/work/42/rpn/Makefile | 21 +++ comp/work/42/rpn/rpn | Bin 0 -> 20864 bytes comp/work/42/rpn/rpn.c | 56 +++++++ comp/work/42/rpn/rpn.o | Bin 0 -> 8656 bytes comp/work/42/rpn/stack.c | 35 ++++ comp/work/42/rpn/stack.h | 10 ++ comp/work/42/rpn/stack.o | Bin 0 -> 4960 bytes comp/work/42/rpn/test.rpn | 1 + comp/work/42/test/test.py | 21 +++ comp/work/42/torpn/torpn.c | 29 ++++ 40 files changed, 436 insertions(+), 27 deletions(-) create mode 100755 bio/1/1 create mode 100644 bio/1/1.c create mode 100644 bio/1/1.c.sh create mode 100644 bio/1/1.txt create mode 100644 bio/1/Makefile create mode 100644 bio/1/count create mode 100755 bio/1/loopstr create mode 100644 bio/1/loopstr.c create mode 100755 bio/3/3 create mode 100644 bio/3/3.c create mode 100644 bio/3/Makefile delete mode 100644 comp/lucas-standen-NEA/code2/Makefile.new delete mode 100644 comp/lucas-standen-NEA/code2/appendsnprintf.o create mode 100644 comp/lucas-standen-NEA/code2/code.zip delete mode 100644 comp/lucas-standen-NEA/code2/comp.o delete mode 100755 comp/lucas-standen-NEA/code2/examples/fib_example delete mode 100755 comp/lucas-standen-NEA/code2/examples/spaceinvaders delete mode 100755 comp/lucas-standen-NEA/code2/examples/str_example delete mode 100644 comp/lucas-standen-NEA/code2/examples/tmp.zpy.c delete mode 100644 comp/lucas-standen-NEA/code2/fileread.o delete mode 100644 comp/lucas-standen-NEA/code2/stdlib/String/String.o delete mode 100644 comp/lucas-standen-NEA/code2/stdlib/zpylib.o delete mode 100644 comp/lucas-standen-NEA/code2/tokenizer.o delete mode 100644 comp/lucas-standen-NEA/code2/util.o delete mode 100755 comp/lucas-standen-NEA/code2/zpy delete mode 100644 comp/lucas-standen-NEA/code2/zpy.o create mode 100644 comp/work/37/stack.o create mode 100644 comp/work/41/exersise.py create mode 100644 comp/work/41/starter.txt create mode 100644 comp/work/42/rpn/Makefile create mode 100755 comp/work/42/rpn/rpn create mode 100644 comp/work/42/rpn/rpn.c create mode 100644 comp/work/42/rpn/rpn.o create mode 100644 comp/work/42/rpn/stack.c create mode 100644 comp/work/42/rpn/stack.h create mode 100644 comp/work/42/rpn/stack.o create mode 100644 comp/work/42/rpn/test.rpn create mode 100644 comp/work/42/test/test.py create mode 100644 comp/work/42/torpn/torpn.c diff --git a/bio/1/1 b/bio/1/1 new file mode 100755 index 0000000..612a0ae Binary files /dev/null and b/bio/1/1 differ diff --git a/bio/1/1.c b/bio/1/1.c new file mode 100644 index 0000000..d086119 --- /dev/null +++ b/bio/1/1.c @@ -0,0 +1,179 @@ +#include +#include +#include +#include +#include + +char *reverse(char *s){ + char *rev = malloc(strlen(s)); + int j = 0; + for (int i = strlen(s)-1; i >= 0; i--){ + rev[j] = s[i]; + j++; + } + rev[j] = 0; + + return rev; +} + +bool ispal(int n){ + char *strnum = malloc(128); + snprintf(strnum, 128, "%d", n); + char *rev = reverse(strnum); + + if (strcmp(rev, strnum) == 0) { // is the same both ways round + free(strnum); + free(rev); + return true; + } + free(strnum); + free(rev); + return false; +} + +int findhighestsumof2(int sums[][2], int sumcount){ + int highest = sums[0][0]; + int highestIndex = 0; + + for (int i = 0; i < sumcount; i++) { + if (sums[i][0] > highest) { + highest= sums[i][0]; + highestIndex = i; + } + if (sums[i][1] > highest) { + highest = sums[i][1]; + highestIndex = i; + } + } + + return highestIndex; +} + +int findlowesetsumof2(int sums[][2], int sumcount){ + if (sumcount == 0) return -1; // no sums + int lowest = sums[0][0]; + int lowestIndex = 0; + bool needscheck = false; + + for (int i = 0; i < sumcount; i++) { + if (sums[i][0] < lowest) { + lowest = sums[i][0]; + lowestIndex = i; + needscheck = false; + } + if (sums[i][1] < lowest) { + lowest = sums[i][1]; + lowestIndex = i; + needscheck = false; + } + if (sums[i][0] == lowest || sums[i][1] == lowest) needscheck == true; + } + if (needscheck) return findhighestsumof2(sums, sumcount); + return lowestIndex; +} + +int findhighestsumof3(int sums[][3], int sumcount){ + int highest = sums[0][0]; + int highestIndex = 0; + + for (int i = 0; i < sumcount; i++) { + if (sums[i][0] > highest) { + highest= sums[i][0]; + highestIndex = i; + } + if (sums[i][1] > highest) { + highest = sums[i][1]; + highestIndex = i; + } + if (sums[i][2] > highest) { + highest = sums[i][2]; + highestIndex = i; + } + } + return highestIndex; +} + +int findlowesetsumof3(int sums[][3], int sumcount){ + if (sumcount == 0) return -1; // no sums + // + int lowest = sums[0][0]; + int lowestIndex = 0; + bool needscheck = false; + + for (int i = 0; i < sumcount; i++) { + if (sums[i][0] < lowest) { + lowest = sums[i][0]; + lowestIndex = i; + needscheck = false; + } + if (sums[i][1] < lowest) { + lowest = sums[i][1]; + lowestIndex = i; + needscheck = false; + } + if (sums[i][2] < lowest) { + lowest = sums[i][2]; + lowestIndex = i; + needscheck = false; + } + if (sums[i][0] == lowest || sums[i][1] == lowest || sums[i][0] == lowest) needscheck == true; + } + if (needscheck) return findhighestsumof3(sums, sumcount); + return lowestIndex; +} + + +int main(int argc, char **argv){ + int input; + if (argc == 1) { + assert(scanf("%d", &input) != 0); + } else input = atoi(argv[1]); + + if (ispal(input)) { // if 1 number is enough + printf("%d\n", input); + return 1; + } + + int sums[input*2][2]; + int sumcount = 0; + for (int i = 1; i < input/2+1; i++){ // if 2 is enough + for (int j = input; j > (input/2) - 1; j--){ + if ((i + j) == input) { + if (ispal(i) & ispal(j)){ + sums[sumcount][0] = i; + sums[sumcount][1] = j; + sumcount++; + } + } + } + } + + int index = findlowesetsumof2(sums, sumcount); + if (index != -1) { + printf("%d %d\n", sums[index][0], sums[index][1]); + return 2; + } + + int triples[input*3][3]; + int triplecount = 0; + for (int i = 0; i < input; i++){ // if 3 is enough + for (int j = 0; j < input; j++){ + for (int k = 0; k < input; k++){ + if ((i + j + k) == input) { + if (ispal(i) & ispal(j) & ispal(k)){ + triples[triplecount][0] = i; + triples[triplecount][1] = j; + triples[triplecount][2] = k; + triplecount++; + } + } + } + } + } + + index = findlowesetsumof3(triples, triplecount); + if (index != -1) { + printf("%d %d %d\n", triples[index][0], triples[index][1], triples[index][2]); + return 3; + } +} diff --git a/bio/1/1.c.sh b/bio/1/1.c.sh new file mode 100644 index 0000000..e05be5a --- /dev/null +++ b/bio/1/1.c.sh @@ -0,0 +1,5 @@ +for i in $(./loopstr 1000000) +do + if [ $(./1 $i | grep -o "[0-9] " | wc -l) == "2" ]; then echo hit; fi + echo $i > ./count +done diff --git a/bio/1/1.txt b/bio/1/1.txt new file mode 100644 index 0000000..2bec6cd --- /dev/null +++ b/bio/1/1.txt @@ -0,0 +1,5 @@ +1)a) see sourcecode +1)b) 1 9 44 +1)c) ... + + diff --git a/bio/1/Makefile b/bio/1/Makefile new file mode 100644 index 0000000..7ba1ac5 --- /dev/null +++ b/bio/1/Makefile @@ -0,0 +1,4 @@ +all: 1.c + cc 1.c -o 1 -ggdb +clean: + rm 1 diff --git a/bio/1/count b/bio/1/count new file mode 100644 index 0000000..113c4d2 --- /dev/null +++ b/bio/1/count @@ -0,0 +1 @@ +1093 diff --git a/bio/1/loopstr b/bio/1/loopstr new file mode 100755 index 0000000..94ee2f9 Binary files /dev/null and b/bio/1/loopstr differ diff --git a/bio/1/loopstr.c b/bio/1/loopstr.c new file mode 100644 index 0000000..8319c19 --- /dev/null +++ b/bio/1/loopstr.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + for (int i = 0; i < atoi(argv[1]); i++){ + printf("%d ", i); + } + printf("\n"); +} diff --git a/bio/3/3 b/bio/3/3 new file mode 100755 index 0000000..83cc1c2 Binary files /dev/null and b/bio/3/3 differ diff --git a/bio/3/3.c b/bio/3/3.c new file mode 100644 index 0000000..3ecb08d --- /dev/null +++ b/bio/3/3.c @@ -0,0 +1,27 @@ +#include + +int main() { + int fusecount; + scanf("%d", &fusecount); + int fuses[fusecount]; + + for (int i = 0; i < fusecount; i++) + scanf("%d", &fuses[i]); + + float burntimes[fusecount * 3]; + int counter = 0; + for (int i = 0; i < fusecount; i++) { + for (int j = 0; j < 3; j++) { // for each state, (dont light, light, light both ends) + if (j == 0) burntimes[counter] = 0; + else if (j == 1) burntimes[counter] = fuses[i]; + else if (j == 2) burntimes[counter] = (float)fuses[i] / 2.0; + counter++; + } + } + + for (int i = 0; i < counter/2; i++) { + for (int j = counter-1; j > counter/2; j--){ + printf("%f %f\n", burntimes[i], burntimes[j]); + } + } +} diff --git a/bio/3/Makefile b/bio/3/Makefile new file mode 100644 index 0000000..6dc3b82 --- /dev/null +++ b/bio/3/Makefile @@ -0,0 +1,4 @@ +all: 3.c + cc 3.c -o 3 -ggdb +clean: + rm 3 diff --git a/comp/lucas-standen-NEA/code2/Makefile.new b/comp/lucas-standen-NEA/code2/Makefile.new deleted file mode 100644 index 8dcb4db..0000000 --- a/comp/lucas-standen-NEA/code2/Makefile.new +++ /dev/null @@ -1,25 +0,0 @@ -CC=cc -CFLAGS=-O3 - -SRC = zpy.c comp.c tokenizer.c fileread.c util.c appendsnprintf.c -OBJ = ${SRC:.c=.o} - -all: zpy - -.c.o: - ${CC} -c ${CFLAGS} $< -zpy: ${OBJ} - ${CC} -o $@ ${OBJ} - cd stdlib && make -install: all - cp zpy /usr/local/bin/zpy - cd stdlib && make install - cd zpypkg && make install -clean: - rm -rf zpy*.o - cd stdlib && make clean - cd examples && make clean -uninstall: - rm /usr/local/bin/zpy - -.PHONY: all clean install uninstall diff --git a/comp/lucas-standen-NEA/code2/appendsnprintf.o b/comp/lucas-standen-NEA/code2/appendsnprintf.o deleted file mode 100644 index 27fd51b..0000000 Binary files a/comp/lucas-standen-NEA/code2/appendsnprintf.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/code.zip b/comp/lucas-standen-NEA/code2/code.zip new file mode 100644 index 0000000..3c6a0a1 Binary files /dev/null and b/comp/lucas-standen-NEA/code2/code.zip differ diff --git a/comp/lucas-standen-NEA/code2/comp.o b/comp/lucas-standen-NEA/code2/comp.o deleted file mode 100644 index eff68f5..0000000 Binary files a/comp/lucas-standen-NEA/code2/comp.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/examples/fib_example b/comp/lucas-standen-NEA/code2/examples/fib_example deleted file mode 100755 index 5422fe2..0000000 Binary files a/comp/lucas-standen-NEA/code2/examples/fib_example and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/examples/spaceinvaders b/comp/lucas-standen-NEA/code2/examples/spaceinvaders deleted file mode 100755 index 5d4134c..0000000 Binary files a/comp/lucas-standen-NEA/code2/examples/spaceinvaders and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/examples/str_example b/comp/lucas-standen-NEA/code2/examples/str_example deleted file mode 100755 index 084ef05..0000000 Binary files a/comp/lucas-standen-NEA/code2/examples/str_example and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c b/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c deleted file mode 100644 index 2305f24..0000000 --- a/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c +++ /dev/null @@ -1,2 +0,0 @@ -#include -int main(){ diff --git a/comp/lucas-standen-NEA/code2/fileread.o b/comp/lucas-standen-NEA/code2/fileread.o deleted file mode 100644 index c7ebfad..0000000 Binary files a/comp/lucas-standen-NEA/code2/fileread.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/stdlib/String/String.o b/comp/lucas-standen-NEA/code2/stdlib/String/String.o deleted file mode 100644 index 6d68e10..0000000 Binary files a/comp/lucas-standen-NEA/code2/stdlib/String/String.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/stdlib/zpylib.o b/comp/lucas-standen-NEA/code2/stdlib/zpylib.o deleted file mode 100644 index f25e724..0000000 Binary files a/comp/lucas-standen-NEA/code2/stdlib/zpylib.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/tokenizer.o b/comp/lucas-standen-NEA/code2/tokenizer.o deleted file mode 100644 index e059ddc..0000000 Binary files a/comp/lucas-standen-NEA/code2/tokenizer.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/util.o b/comp/lucas-standen-NEA/code2/util.o deleted file mode 100644 index f9420e9..0000000 Binary files a/comp/lucas-standen-NEA/code2/util.o and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/zpy b/comp/lucas-standen-NEA/code2/zpy deleted file mode 100755 index 6ad15f3..0000000 Binary files a/comp/lucas-standen-NEA/code2/zpy and /dev/null differ diff --git a/comp/lucas-standen-NEA/code2/zpy.o b/comp/lucas-standen-NEA/code2/zpy.o deleted file mode 100644 index b3a1ccf..0000000 Binary files a/comp/lucas-standen-NEA/code2/zpy.o and /dev/null differ diff --git a/comp/work/37/rpn b/comp/work/37/rpn index e087f49..a2bc627 100755 Binary files a/comp/work/37/rpn and b/comp/work/37/rpn differ diff --git a/comp/work/37/stack.o b/comp/work/37/stack.o new file mode 100644 index 0000000..0b144c4 Binary files /dev/null and b/comp/work/37/stack.o differ diff --git a/comp/work/41/exersise.py b/comp/work/41/exersise.py new file mode 100644 index 0000000..2633c4c --- /dev/null +++ b/comp/work/41/exersise.py @@ -0,0 +1,24 @@ +def getdigits(number): + digits = [] + for i in number: + digits.append(int(i)) + return digits + +def testnumber(number): + d = getdigits(number) + total = sum(d) + + if (int(number) % total) == 0: + return True + return False + +n = int(input("which harshad number should you go to: ")) + +count = 0 +i = 0 +while count < n: + i += 1 + if testnumber(str(i)): + count += 1 + +print(i) diff --git a/comp/work/41/starter.txt b/comp/work/41/starter.txt new file mode 100644 index 0000000..e7328a1 --- /dev/null +++ b/comp/work/41/starter.txt @@ -0,0 +1,5 @@ +1) bundling data with relevant functions to do with the data +2) a class is the blueprint for an object, it will contain atributes (variables), and methods (functions) that can be used to manipulate/set or retrive the atributes +3) an object is the instance of a class in memory, it can be treated as a variable +4) this is the creation of an object from a class, it will often contain an initilization function to allow for it to have starting values +5) inheritence is the concept of creating a subclass that contains the same methods and atributes as an existing object and more data, it is a derived class diff --git a/comp/work/42/rpn/Makefile b/comp/work/42/rpn/Makefile new file mode 100644 index 0000000..6718c5b --- /dev/null +++ b/comp/work/42/rpn/Makefile @@ -0,0 +1,21 @@ +CC=cc +CFLAGS=-ggdb -Wextra -Wall -Werror +LIBS=-lm + +SRC = rpn.c stack.c +OBJ = ${SRC:.c=.o} + +all: rpn + +.c.o: + ${CC} -c ${CFLAGS} $< +rpn: ${OBJ} + ${CC} -o $@ ${OBJ} ${LIBS} +install: all + cp rpn /usr/local/bin/rpn +clean: + rm -rf rpn *.o +uninstall: + rm /usr/local/bin/rpn + +.PHONY: all clean install uninstall diff --git a/comp/work/42/rpn/rpn b/comp/work/42/rpn/rpn new file mode 100755 index 0000000..424fbc5 Binary files /dev/null and b/comp/work/42/rpn/rpn differ diff --git a/comp/work/42/rpn/rpn.c b/comp/work/42/rpn/rpn.c new file mode 100644 index 0000000..f5cd6b7 --- /dev/null +++ b/comp/work/42/rpn/rpn.c @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include "stack.h" + +char *readword(FILE *f) { + if (getc(f) == EOF) return NULL; + fseek(f, -1, SEEK_CUR); + + char *word = malloc(10); + char c; + int i = 0; + while ((c = getc(f)) != ' ') { + if (c == EOF || c == '\n') break; + word[i] = c; + i++; + } + word[i] = 0; + return word; +} + +int main() { + FILE *f = fopen("test.rpn", "r"); + stack *s = initstack(0 ,100); + + char *word; + int a, b; + while ((word = readword(f)) != NULL) { + if (!isdigit(word[0])) { + b = pop(s); + a = pop(s); + switch (word[0]) { + case '+': push(s, a+b); break; + case '-': push(s, a-b); break; + case '*': push(s, a*b); break; + case '/': push(s, a/b); break; + case '^': push(s, pow(a, b)); break; + case '~': + push(s, a); + push(s, -b); + break; + default: + printf("unknown symbol %c\n",word[0]); + exit(1); + break; + } + } + else push(s, atoi(word)); + free(word); + } + printf("%d\n", pop(s)); + + deinitstack(s); +} diff --git a/comp/work/42/rpn/rpn.o b/comp/work/42/rpn/rpn.o new file mode 100644 index 0000000..169c928 Binary files /dev/null and b/comp/work/42/rpn/rpn.o differ diff --git a/comp/work/42/rpn/stack.c b/comp/work/42/rpn/stack.c new file mode 100644 index 0000000..0311404 --- /dev/null +++ b/comp/work/42/rpn/stack.c @@ -0,0 +1,35 @@ +#include +#include + +typedef struct stack { + int *sp; + int value; + int *stack; +} stack; + +int pop(stack *stack){ + stack->sp -= sizeof(int); + int i = *stack->sp; + *stack->sp = stack->value; + return i; +} + +void push(stack *stack, int value){ + *stack->sp = value; + stack->sp += sizeof(int); +} + +void deinitstack(stack *stack){ + free(stack->stack); + free(stack); + stack = NULL; +} + +stack *initstack(int value, size_t size){ + stack *s = malloc(sizeof(stack)); + s->stack = calloc(0, size*sizeof(int)); + s->sp = s->stack; + s->value = value; + return s; +} + diff --git a/comp/work/42/rpn/stack.h b/comp/work/42/rpn/stack.h new file mode 100644 index 0000000..0c78a10 --- /dev/null +++ b/comp/work/42/rpn/stack.h @@ -0,0 +1,10 @@ +typedef struct stack { + int *sp; + int value; + int *stack; +} stack; + +int pop(stack *stack); +void push(stack *stack, int value); +void deinitstack(stack *stack); +stack *initstack(int value, int size); diff --git a/comp/work/42/rpn/stack.o b/comp/work/42/rpn/stack.o new file mode 100644 index 0000000..05aa2e6 Binary files /dev/null and b/comp/work/42/rpn/stack.o differ diff --git a/comp/work/42/rpn/test.rpn b/comp/work/42/rpn/test.rpn new file mode 100644 index 0000000..02f9f8a --- /dev/null +++ b/comp/work/42/rpn/test.rpn @@ -0,0 +1 @@ +2 ~ 4 + diff --git a/comp/work/42/test/test.py b/comp/work/42/test/test.py new file mode 100644 index 0000000..4e70d92 --- /dev/null +++ b/comp/work/42/test/test.py @@ -0,0 +1,21 @@ +def tostring(list): + string = "" + for i in list: + string += str(i) + print(string) + +def getbin(n): + out = [] + while (n >= 1): + out.append(n % 2) + n = int(n / 2) + + out.reverse() + return out + +def tobin(n): + raw = getbin(n) + tostring(raw) + +n = int(input("what number would you like to convert: ")) +tobin(n) diff --git a/comp/work/42/torpn/torpn.c b/comp/work/42/torpn/torpn.c new file mode 100644 index 0000000..58b939a --- /dev/null +++ b/comp/work/42/torpn/torpn.c @@ -0,0 +1,29 @@ +#include +#include +#include + +typedef enum op { + ADD = '+', + SUB = '-', + MUL = '*', + DIV = '/', +} op; + +typedef struct ast { + op o; + int val1; + struct ast *child1; + + int val2; + struct ast *child2; +} ast; + +int main(){ + FILE *f = fopen("test.in", "r"); + char *expr = malloc(256); + fgets(expr, 256, f); + + for (int i = 0; i < strlen(expr); i++){ + + } +} -- cgit v1.2.3