https://github.com/sanidhyy/donut
donut.c, remade in JS... and the code still looks like a donut 🍩
https://github.com/sanidhyy/donut
ascii ascii-art c c-plus-plus c-sharp css donut donut-js html javascript js ts typescript
Last synced: 5 months ago
JSON representation
donut.c, remade in JS... and the code still looks like a donut 🍩
- Host: GitHub
- URL: https://github.com/sanidhyy/donut
- Owner: sanidhyy
- Created: 2024-05-06T11:59:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-09T17:02:07.000Z (over 1 year ago)
- Last Synced: 2024-12-26T23:43:49.450Z (10 months ago)
- Topics: ascii, ascii-art, c, c-plus-plus, c-sharp, css, donut, donut-js, html, javascript, js, ts, typescript
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🍩 donut.js
```javascript
let A=0,B=0,M=
Math;const a=()=>{let s
=[],t=[];A+=.05,B+=.07;const
o=M.cos(A),e=M.sin(A),n=M.cos(B
),c=M.sin(B);for (let o=0;o<1760;
o++)s[o]=o%80==79?"\n":" ",t[o]=0;for
(let i=0;i<6.28;i+=.07){const r=M.cos(
i),a=M.sin(i);for(let i=0;i<6.28;i+=.02
){const l=M.sin (i),f=M.cos(i),A
=r+2,B=1/(l*A* e+a*o+5),d=l*A*
o-a*e,m=40+30* B*(f*A*n-d*c)|0
,v=12+15*B*(f*A *c+d*n)|0,I=m+80
*v,h=8*((a*e-l*r*o)*n-l*r*e-a*o-f*r*c)|
0;v<22&&v>=0&&m>=0&&m<79&&B>t[I]&&(t[
I]=B,s[I]=".,-~:;=!*#$@"[h>0?h:0])}}
process.stdout.write(`\x1b[J\x1b[H`
+s.join(""))},i=setInterval(a,50
);/*Sanidhya Kumar Verma*/
/*~~;!!!!!!!!!!!;~~*/
/*.,-------,.*/
```## 🚀 How to Run
- Use Node:
```bash
node donut.min.js
```
- or just open `index.html` :)`donut.c`, remade in JS... and the code still looks like a donut!
`index.js` is the original code, and `donut.js` is the actual donut-shaped obfuscated code.
If the donut looks elliptical, then you may need to adjust your font to be more square, or just modify line width and font spacing to make it more square.