-
Notifications
You must be signed in to change notification settings - Fork 0
Add files via upload #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #include <stdio.h> | ||
| #include <math.h> | ||
| #include <stdint.h> | ||
| #include <string.h> | ||
| #include <unistd.h> | ||
|
|
||
| int main() { | ||
| float A = 0, B = 0; | ||
| float i, j; | ||
| int k; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
| float z[1760]; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The size of
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive variable name than |
||
| char b[1760]; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's good practice to use a constant for the terminal escape sequence to enhance readability and maintainability.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is good practice to use a descriptive variable name instead of a single letter for
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, |
||
| printf("\x1b[2J"); | ||
| for(;;) { | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a comment explaining the purpose of the |
||
| memset(b,32,1760); | ||
| memset(z,0,7040); | ||
| for(j=0; j < 6.28; j += 0.07) { | ||
| for(i=0; i < 6.28; i += 0.02) { | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The constant
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's recommended to avoid using magic numbers. Consider defining constants for values like 6.28, 0.07, and 0.02. This will enhance code readability and maintainability. |
||
| float c = sin(i); | ||
| float d = cos(j); | ||
| float e = sin(A); | ||
| float f = sin(j); | ||
| float g = cos(A); | ||
| float h = d + 2; | ||
| float D = 1 / (c * h * e + f * g + 5); | ||
| float l = cos(i); | ||
| float m = cos(B); | ||
| float n = sin(B); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using |
||
| float t = c * h * g - f * e; | ||
| int x = 40 + 30 * D * (l * h * m - t * n); | ||
| int y= 12 + 15 * D * (l * h * n + t * m); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
| int o = x + 80 * y; | ||
| int N = 8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| if(22 > y && y > 0 && x > 0 && 80 > x && D > z[o]) { | ||
| z[o] = D; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
| b[o] = ".,-~:;=!*#$@"[N > 0 ? N : 0]; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code uses |
||
| } | ||
| } | ||
| } | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using |
||
| printf("\x1b[H"); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be better to use a more descriptive variable name than
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code uses |
||
| for(k = 0; k < 1761; k++) { | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| putchar(k % 80 ? b[k] : 10); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's good practice to add a comment explaining why you're using |
||
| A += 0.00004; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive variable name than |
||
| B += 0.00002; | ||
| } | ||
| usleep(30000); | ||
| } | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a good practice to add a comment explaining the purpose of the |
||
| return 0; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using
bzeroinstead ofmemsetfor zeroing out memory. It might be slightly more efficient in this case.