This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Created by Matthew Siu on 2017-1-17. | |
http://www.matthewsiu.com/ | |
https://github.com/Siunami | |
https://www.linkedin.com/in/matthewwilsonsiu | |
*/ | |
// BEGIN WITH PIN 5 | |
// This can be changed to any starting values desired | |
int pinState[10] = {LOW, LOW, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, LOW}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Shooter { | |
float x; | |
float y; | |
color colour = color(random(0,255), random(0,255), random(0,255)); | |
float xspeed = random(-10,10); | |
float yspeed = random(-10,10); | |
Shooter(float x, float y) { | |
this.x = x; | |
this.y = y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Input is a queue | |
// Ex : 100,200,300,400,500 | |
// key = an element in the queue | |
void Queue::move_to_front(const QueueElement & key) { | |
Node *curr = myFront; | |
Node *temp = myFront; | |
int moreVal = true; | |
cout << "Debug: " << endl; | |
cout << curr->data << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Queue Queue::merge_two_queues(Queue & q){ | |
NodePointer queue1 = myFront; | |
NodePointer queue2 = q.myFront; | |
Queue newQueue; | |
while (queue1 != NULL || queue2 != NULL){ | |
if (queue1 == NULL){ | |
newQueue.enqueue(queue2->data); | |
queue2 = queue2->next; | |
} else if (queue2 == NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x11097196F2a9b613Fde623fEF2162edfE6037d24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var option = 0; | |
var numSketches = 5; | |
var explanation = false; | |
// Experience 3 | |
// Experience 4 | |
var objects = []; | |
//Experience 5 | |
var smoothedSensorX = 0; | |
var smoothedSensorY = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Calendar; | |
class Node extends PVector { | |
PVector velocity = new PVector(); | |
float minX=5, minY=5, maxX=width-5,maxY=height-5; | |
float damping = 0.000001; | |
int r,g,b; | |
int trailLength = 5; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WIDTH = 600; | |
var HEIGHT = 400; | |
function setup() { | |
createCanvas(WIDTH,HEIGHT); | |
} | |
var bombs = []; | |
var particles = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: | |
// Fix leaves so that they are actually on the tree. | |
// Right now leaves blow in the wind | |
var WIDTH = 500; | |
var HEIGHT = 600; | |
function setup() { | |
createCanvas(WIDTH,HEIGHT); | |
smooth(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Daniel Shiffman | |
// http://codingtra.in | |
// http://patreon.com/codingtrain | |
// Code for: https://youtu.be/BjoM9oKOAKY | |
function Particle() { | |
this.pos = createVector(random(width), random(height)); | |
this.vel = createVector(0, 0); | |
this.acc = createVector(0, 0); | |
this.maxspeed = 2; |
OlderNewer