Skip to content

Instantly share code, notes, and snippets.

View Galacs's full-sized avatar

Rémi Ait-Younes Galacs

View GitHub Profile
@Galacs
Galacs / arc_en_ciel.py
Last active January 26, 2022 17:28
arc_en_ciel
from math import *
from kandinsky import *
from random import *
from math import *
def degrade(c1,c2,k):
dr=c2[0]-c1[0]
dg=c2[1]-c1[1]
db=c2[2]-c1[2]
return color(c1[0]+int(k*dr),
c1[1]+int(k*dg),c1[2]+int(k*db))
@Galacs
Galacs / rosace.py
Created January 26, 2022 17:18
rosace
from kandinsky import *
from math import *
def cercle1(x0,y0,r,c,e):
for i in range(2*e):
xd=x0-int((r-i*0.5)/sqrt(2))
xf=x0+int((r-i*0.5)/sqrt(2))
for x in range(xd,xf+1):
x1=x
y1=y0+int(sqrt((r-i*0.5)**2-(x-x0)**2))
if sqrt((160-x1)**2+(111-y1)**2)<r:
@Galacs
Galacs / drapeau.py
Created January 26, 2022 17:17
drapeau
from kandinsky import *
def rect(x,y,L,r,v,b):
c=color(r,v,b)
for i in range(L):
for j in range (2*L):
set_pixel(x+i,y+j,c)
def rect2(x,y,L,r,v,b):
c=color(r,v,b)
@Galacs
Galacs / re.py
Created January 26, 2022 17:08
re
#
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@pythonware.com).
@Galacs
Galacs / base64.py
Last active January 26, 2022 17:12
base64
#! /usr/bin/env python3
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
# import re
import struct
@Galacs
Galacs / sa.py
Last active January 26, 2022 17:05
test
from math import *