Skip to content

Commit

Permalink
Update 2022-12-12-file-calculator.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aidankeighron authored Nov 26, 2023
1 parent 66dbc98 commit 3eb2745
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/all_collections/_posts/2022-12-12-file-calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public int add(int x1, int x2) {
}
```

Because it takes up space. For this project, we are trying to limit the space of whatever does the calculations i.e., `return x1 + x2`. Nearly every programming language except for a few esoteric languages has a file size that is greater than zero bytes. So how is creating a zero-byte calculator possible? First, let me clarify a few things. For this project, there will be a program (written in java for no particular reason) to generate this calculator and perform operations with it. The actual calculations will still be done with zero bytes but we will be using a program to interact with it.
Because it takes up space. For this project, we are trying to limit the space of whatever does the calculations, i.e., `return x1 + x2`. Nearly every programming language except for a few esoteric languages has a file size that is greater than zero bytes. So how is creating a zero-byte calculator possible? First, let me clarify a few things. For this project, there will be a program (written in Java for no particular reason) to generate this calculator and perform operations with it. The actual calculations will still be done with zero bytes, but we will be using a program to interact with it.

Folders and empty files "technically" take up zero space (They do take up space in your filesystem's metadata files but we are talking about their size according to their properties). Because of that, we will be using both folders and empty files to create the calculator. As much as I would love to make a graphing calculator out of folders and files, I don't want my computer to spend the rest of its life generating them. So let's add some restrictions so we are not generating millions of folders and files.
Folders and empty files "technically" take up zero space (they do take up space in your filesystem's metadata files, but we are talking about their size according to their properties). Because of that, we will be using both folders and empty files to create the calculator. As much as I would love to make a graphing calculator out of folders and files, I don't want my computer to spend the rest of its life generating them. So let's add some restrictions so we are not generating millions of folders and files.

- Calculable numbers are from 0 and 1000
- Calculable numbers range from 0 and 1000
- The only operation available is addition


Expand Down Expand Up @@ -179,4 +179,4 @@ for (int i = 0; i < size; i++) {
```
I will talk a bit about how I found the $$O(n)$$ size complexity for this project. N is the size of calculable numbers i.e., calculable numbers from 0 to 1000 would have an N of 1001. The $$O(n)$$ for the files is simply just `size * numColumns` as seen above and the same is true for the 2nd dimension of files with the 1st dimension being just `size`.

Full code: [Calculator](https://github.com/aidankeighron/Calculator){:target="\_blank"}
Full code: [Calculator](https://github.com/aidankeighron/Calculator){:target="\_blank"}

0 comments on commit 3eb2745

Please sign in to comment.