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
// 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
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
/* | |
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}; |
NewerOlder