Skip to content

Instantly share code, notes, and snippets.

View villares's full-sized avatar
💥

Alexandre B A Villares villares

💥
View GitHub Profile
void setup() {
size(400, 400);
frameRate(5);
}
void draw() {
background(0);
stroke(255);
raio(width/2, 0, 10);
}
// Recursive lightning
// Raio recursivo
void setup() {
size(400, 400);
frameRate(2);
}
void draw() {
background(0);
// Delaunay Triangulation & Convex Hull
// by Justin Dailey
// https://www.openprocessing.org/sketch/62502#
class Face
{
// The three points of the face
PVector[] ps;
'''From Coding Train
https://youtu.be/BAejnwN4Ccw
3/2/2017
Added Genetic Algorithm
4/27/2017
'''
import random
cities = [];
@villares
villares / clock.py
Created June 28, 2017 19:19 — forked from fmasanori/clock.py
Clock GUI
import tkinter
from time import strftime
#by Luciano Ramalho
clock = tkinter.Label()
clock.pack()
clock['font'] = 'Helvetica 120 bold'
clock['text'] = strftime('%H:%M:%S')
"""
* Listing files in directories and subdirectories
* inspired by an example by Daniel Shiffman.
*
* 1) List the names of files in a directory
* 2) List the names along with metadata (size, lastModified)
* of files in a directory
* 3) List the names along with metadata (size, lastModified)
* of files in a directory and all subdirectories (using recursion)
"""
def setup():
""" Create a Bandeirinha instance """
global flag
size(100, 100) # Canvas size
flag = Bandeirinha(width / 2, height / 2)
def draw():
""" The 'main loop' invoked by Processing """
background(0) # Cleans the canvas, with black
flag.plot()
@villares
villares / GettingStartedWithCapture.pde
Last active November 4, 2017 16:57
exemplo Getting Started with Capture de Processing
/**
* Traduzido do exemplo Getting Started with Capture (Processing.org)
* Reading and displaying an image from an attached Capture device.
*/
import processing.video.*;
Capture cam;
void setup() {
<html>
<head>
<meta charset="UTF-8">
<!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.16/p5.js"></script>
<script language="javascript" type="text/javascript" src="p5js_madness_tetrahedrons.js"></script>
<!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->
<!-- This line removes any default padding and style.
"""
Python template for creating a looping animation in Processing.py.
When you press the 'F' key, this program will export a series of images
into a "frames" directory located in its sketch folder.
These can then be combined into an animated gif.
Known to work with Processing 3.3.6
Prof. Golan Levin, January 2018
"""
#===================================================
# Global variables.