Skip to content

Instantly share code, notes, and snippets.

View Ptolemy2002's full-sized avatar

Ptolemy Bryce Henson Ptolemy2002

View GitHub Profile
class Main {
public static void test(int roadRunner, int coyote, int edge) {
System.out.println("Roadrunner Position: " + roadRunner + "; Coyote Position: " + coyote + "; edge: " + edge + ";");
System.out.println();
if (!(roadRunner < edge)) {
System.out.println("Roadrunner did not run.");
}
@Ptolemy2002
Ptolemy2002 / Artist.js
Created January 5, 2018 02:07
A library for the HTML5 canvas
var canvas = document.getElementById("canvas");
var infoLabel = document.getElementById("text");
//Array of existing images
var images = [];
//How many images have loaded
var imagesLoaded = 0;
//Color stop used for creating gradients
var colorStop = function(location, color) {
this.location = location;
this.color = color;
@Ptolemy2002
Ptolemy2002 / Canvas2.js
Last active October 10, 2017 22:43
The current code in my program
// JavaScript File
var Canvas = document.getElementById("canvas");
var label = document.getElementById("text");
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
function rgbToHex(r, g, b) {
@Ptolemy2002
Ptolemy2002 / Canvas1.js
Created October 10, 2017 22:40
The current code in my program
// JavaScript File
var Canvas = document.getElementById("canvas");
var label = document.getElementById("text");
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
function rgbToHex(r, g, b) {