From 99cfcb40d2cdf38e63438020e52f5f72c70c72fc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 23 Dec 2023 21:49:23 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- LICENSE | 23 +++++++++++++++++++++++ README | 3 +++ doughnut.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 LICENSE create mode 100644 README create mode 100644 doughnut.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fae88b9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2021 Julius Šyvis (single-line implemention, this work is derived from) + +Copyright (c) 2023 Mattias Andrée + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..86f4003 --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +Doughnut shaped Python code that renders an animated doughnut. + +Based on https://github.com/Julius-Syvis/DonutPy diff --git a/doughnut.py b/doughnut.py new file mode 100644 index 0000000..577aa57 --- /dev/null +++ b/doughnut.py @@ -0,0 +1,28 @@ +ᅠ =lambda:([(pr) + () for b in[[ (fun() ,b) + for(z)in[[((0))for(XX)in range + (1760)]] for (b) in[[("\n") if (k % + 80) == 79 else(" ") for k in range (1760) + ]] for o, D, N in [(o,D,N) for j in range (0, + 628, 7) for i in range(0, 628, 2) for (c, d, e, + f, g, l, m, n) in [(sin (i / 100), cos (j / 100), + sin (A), sin ((j) / 100), cos (A), cos ((i) / 100), + cos (A), sin (A) )] for h in [ d + 2 ] for (D, t) in + [( 1 / (c * h * e + f * g + 5), (c * h * g - f * +e)) ] for (x , y) in[ (int(################# +#################### #### License: MIT ### +## Copyright 2023 # #################### +## Mattias Andrée # # Based on work by # +#################### # Julius Šyvis 2021 # + 40+30*D*(l*h*m-t*n)), int(12+15*D *(l*h*n+t + *m)))]for(o,N)in[(x+80* y,int(8*((f*e-c*d*g)*m-c + *d*e-f*g-l*d*n)))]if 0y>0]if D>z[o]for + fun in[lambda:z.pop(o),lambda:z.insert(o,D),lambda + :b.pop(o), lambda : b.insert(o, ".,-~:;=!*#$@"[N + if N>0 else 0])]][0][1]] for pr in[lambda:print + ("\x1b[H"),lambda:print("".join(b))]] and A + + 0.02);A,sin,cos=0,__import__('math').sin,\ + __import__('math').cos;print("\x1b[2" + "J");any(0 for _ in __import__( + 'iter'+'tools').repeat(0) + if (A :=ᅠ())) -- cgit v1.2.3-70-g09d2