Skip to content

Instantly share code, notes, and snippets.

@CONKLCHA001
CONKLCHA001 / Projectile_calculator
Created June 13, 2018 21:19
Simple projectile calculator with animation. No UI.
Projectile1 projectile1;
boolean animation = false;
public float jupiter = 24.92;
public float neptune = 11.15;
public float saturn = 10.44;
public float earth = 9.8;
public float uranus = 8.871;
public float venus = 8.872;
public float mars = 3.71;
public float mercury = 3.7;
@CONKLCHA001
CONKLCHA001 / Worms.
Created June 7, 2018 20:56
Interactive worms. Press space to have all worms track your cursor's movement and press space again to return to normal.
Streamer streamer;
streamer_system stsy;
boolean space;
void setup() {
size(900, 900, P2D);
// changes origin.
streamer = new Streamer();
stsy = new streamer_system();
@CONKLCHA001
CONKLCHA001 / Genetic Algorithm
Last active June 7, 2018 20:53
Maze solving genetic algorithm based off of an example from chapter 9 of the book Nature of Code. Use space to switch to maze then left click to start.
int lifetime;
Population population;
int lifecycle;
int recordtime;
Obstacle target;
ArrayList<Obstacle> obstacles;
int obstacleFormation = 0;
boolean check = false;
boolean go;
PImage img;
@CONKLCHA001
CONKLCHA001 / 10 Print modified.
Created January 11, 2018 21:45
Charles Conklin - 10 print changes.
float x = 0;
float y = 0;
float spacing = 20;
void setup()
{
size(400,400);
background(0);
@CONKLCHA001
CONKLCHA001 / finding_sum_of_two_multiples_below_a_value
Last active November 27, 2017 17:18
Project Euler - Finding sum of two multiples below a given value.
// Code is based off of an anon. question off of processing.org/discourse.
// I made a mathematical correction.
// I changed the code to allow an easier time manipulating values.
// Added pseudo code for proof of understanding.
// Three manipulated Variables
// Changed where values were defined to allow correction of mathematical error.
int findvaluesbelowthisnumber = 1000; // Sum of two multiples below this number.
@CONKLCHA001
CONKLCHA001 / Playing With Processing
Created October 31, 2017 16:56
Playing With Processing
Me me;
Bullet bullet;
import processing.serial.*;
Serial myPort;
int direction = 0;
int button = 0;
void setup()
{
size(600,600);
myPort = new Serial(this,"/dev/cu.usbmodem1411",9600);
@CONKLCHA001
CONKLCHA001 / Drawing Program
Created October 31, 2017 16:51
Drawing Program
int r = 10;
int g = 10;
int b = 10;
void setup()
{
size(850, 1100);
background (255);
}
void draw()
@CONKLCHA001
CONKLCHA001 / Mondrian
Created October 31, 2017 16:48
Mondrian
void setup()
{
size(400,400);
background(128,0,128);
fill(0,0,128);
strokeWeight(5);
rect(2.5,2.5,200,100); //
fill(255,223,0);
strokeWeight(5);
rect(202.5,47.5,100,300); //
@CONKLCHA001
CONKLCHA001 / Vector Assignment - Charlie Conklin
Created October 27, 2017 19:37
Vector Assignment - Charlie Conklin
Ball ball;
Square square;
int Squarex; //The "square's" x location.
int Squarey; //The "square's" y location.
void setup()
{
size(600,600); // Sets background size.
background(0); // Sets the color of background.
ball = new Ball(); // Calls on the "Ball" class to construct a new "ball."
square = new Square(); // Calls on the "Square" class to construct a new "square."
import processing.serial.*;
Serial myPort;
String val;
void setup()
{
background(255);
size(500,500);
String usbmodem1421 = Serial.list()[0];
myPort = new Serial(this, "/dev/cu.usbmodem1421", 9600);