IOPCC 2023 submission
This commit is contained in:
parent
2b876fcf50
commit
704503d6e0
11
README.md
11
README.md
|
@ -2,9 +2,16 @@
|
|||
|
||||
"International Obfuscated Python Code Competition" and other codes...
|
||||
|
||||
|
||||
# palindrome
|
||||
## palindrome
|
||||
|
||||
_yp.py_ is a source code which has the property of outputs its own source code reversed
|
||||
which you can execute again to obtain the same code.
|
||||
|
||||
|
||||
## iopcc 2023
|
||||
|
||||
My submission to iopcc 2023. This source code compute fibonacci numbers by giving script
|
||||
the range of the month.
|
||||
|
||||
Plus, source code has been tweaked to be seen as a rabbit in ASCII art.
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
x,y=[6 ,11]\
|
||||
,[ 48,67 ];s\
|
||||
=[ x for x \
|
||||
in vars ( )]\
|
||||
;b= vars( )[s[ x[
|
||||
0]]] ;k= list( (b.
|
||||
__dict__ .keys (
|
||||
) )) ;g= getattr(b
|
||||
,k[x[1]*2]);m=g(
|
||||
b,k[y[1]+1]);l=g\
|
||||
(b ,k
|
||||
[x [1
|
||||
]* 3] ); i=\
|
||||
g( b, k[ x[
|
||||
1] *6]);p =g\
|
||||
(b ,k[y[0 ]-
|
||||
x[0]]) ;a=g(g(b,k
|
||||
[x[0]] )("".join(
|
||||
m( g(b,k[ x[
|
||||
0] //2+x[ 1]
|
||||
]) ,(m( g(
|
||||
b, k[y[ 0]
|
||||
-1 ]) ,g(b,k[x [1]+
|
||||
y[ 1] +1])([*[ g(b,
|
||||
k[ y[0]-1]) (y)] *3
|
||||
], [0,x[0], 0])) ))
|
||||
)) ,"". join(m(g(b
|
||||
,k [x[0 ]//2+x[1]]
|
||||
), (m (g
|
||||
(b ,k [y
|
||||
[0 ]- 1]
|
||||
), g( b,
|
||||
k[x[1] +y[1 ]+1]
|
||||
)([*[g (b,k [y[0
|
||||
]- 1])( y) ]*4],[x[0]*- 3,-1
|
||||
,x [0]* -2 ,x[0]//2]))) )));
|
||||
p(i((1/5**.5)*(((1+5**.5)/2)**(i(a[1])+1)-((1
|
||||
-5**.5)/2)**(i(a[1])+1)))) if l(a)>1 else p(1)
|
||||
|
||||
# Rabbits are great to compute fibonnacci numbers
|
||||
# ASCII art freely inspired from Row - https://www.asciiart.eu/animals/rabbits
|
||||
# (c) 2023 Mindiell
|
|
@ -0,0 +1,36 @@
|
|||
# Remarks
|
||||
|
||||
This source code returns the fibonacci number at the end of the nth month as explained
|
||||
on wikipedia : https://en.wikipedia.org/wiki/Fibonacci_sequence
|
||||
|
||||
When used without any argument, it works like month 0.
|
||||
|
||||
As stated in the source code: "Rabbits are great to compute fibonnacci numbers"
|
||||
|
||||
## Author
|
||||
|
||||
Mindiell (iopcc@mindiell.net)
|
||||
|
||||
### Help and acknowledgments
|
||||
|
||||
Thanks to AFPy and especially to mdk and entwanne for their help.
|
||||
Thanks to Row for its original ASCII art of a delicious rabbit.
|
||||
|
||||
## Usage
|
||||
|
||||
python fibonacci.py N
|
||||
|
||||
Where N is the month. It returns corresponding fibonacci number.
|
||||
|
||||
## Compatibility
|
||||
|
||||
No external library is necessary to run it.
|
||||
|
||||
### Python versions
|
||||
|
||||
It should work on python 3.10 and 3.11 only.
|
||||
|
||||
### OS
|
||||
|
||||
It has been succesfully launched on Debian and WSL Debian.
|
||||
|
Loading…
Reference in New Issue