Skip to content

Instantly share code, notes, and snippets.

View Mizzlr's full-sized avatar

Mushtaque Ahamed A Mizzlr

View GitHub Profile
eval(z='p="<"+"pre>"/* ,.oq#+ ,._, */;for(y in n="zw24l6k\
4e3t4jnt4qj24xh2 x/* =<,m#F^ A W###q. */42kty24wrt413n243n\
9h243pdxt41csb yz/* #K q##H######Am */43iyb6k43pk7243nm\
r24".split(4)){/* dP cpq#q##########b, */for(a in t=pars\
eInt(n[y],36)+/* p##@###YG=[#######y */(e=x=r=[]))for\
(r=!r,i=0;t[a/* d#qg `*PWo##q#######D */]>i;i+=.05)wi\
th(Math)x-= /* aem1k.com Q###KWR#### W[ */.05,0>cos(o=\
new Date/1e3/* .Q#########Md#.###OP A@ , */+x/PI)&&(e[~\
~(32*sin(o)*/* , (W#####Xx######.P^ T % */sin(.5+y/7))\
+60] =-~ r);/* #y `^TqW####P###BP */for(x=0;122>\
eval=eval=eval='eval$s=%q(eval(%w(puts((%q(eval=ev
al=eval=^Z^##^_/#{eval@eval@if@eval)+?@*10+%(.size
>#{(s=%(eval$s=%q(#$s)#)).size-1}}}#LMNOPQRS_##thx
.flagitious!## )+?@*12+%(TUVW XY/.i@rescue##
/_3141592653 589793+)+?@* 16+%(+271828
182845904; _987654321 0;;eval)+?
@*18+%("x =((#{s.s um}-eval.
_sum)%256 ).chr; ;eval)+?@
*12+%(.s can(//){ a=$`+x+$
^_a.unpa ck (^ H*^)[0].
_='_=%r;print _%%_';print _%_
import argparse, re, math, sys, time, os
class HuffmanNode:
"""
Node Object that supports Merging operation as in the
Huffman Encoding Algorithm.
self.list_of_chars: list of characters at a node which share
a common ancestors in the Huffman Tree.
self.count: number of times the element in the list of
[ FRWD ] B
[ FRWD ] B
[ PUSH ] ((0.00,-160.00), 90.0)
[ RGHT ] +
[ FRWD ] B
[ PUSH ] ((17.32,-150.00), 30.0)
[ RGHT ] +
[ FRWD ] A
[ POP ] ((17.32,-150.00), 30.0)
[ LEFT ] -
Generated code:
[ 0 ] A
[ 1 ] B[+A]-A
[ 2 ] BB[+B[+A]-A]-B[+A]-A
[ 3 ] BBBB[+BB[+B[+A]-A]-B[+A]-A]-BB[+B[+A]-A]-B[+A]-A
[ 4 ] BBBBBBBB[+BBBB[+BB[+B[+A]-A]-B[+A]-A]-BB[+B[+A]-A]-B[+A]-A]-BBBB[+BB[+B[+A]-A]-B[+A]-A]-BB[+B[+A]-A]-B[+A]-A
# L-System code for pythagorian tree
variables: A B
constants: [ ] + -
axiom: A
rules: (B->BB) (A->B[+A]-A)
angle: 60
length: 20
@Mizzlr
Mizzlr / lsystem.py
Last active February 22, 2019 20:14
import sys, os
import turtle as tt
screen = tt.Screen()
class Lsystem:
"Class to compile and draw lsystem with turtle"
def __init__(self, save_every_frame=False,
speed=0):
self.name = ''
var PLUS = function (n) {
return function(m) {
return function(f) {
return function(z) {
return n(f)(m(f)(z));
};
};
};
};
function incr(x) { return x+1;};
var zero = 0;
// so numerify is
function numerify(churchNumeral){
return churchNumeral(incr)(zero);
};