This file contains 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
// <First Name> <Last Name> | |
// <Class period> | |
// Directions: Fill in the missing variables and methods to create the Store class. | |
// Their will only be 3 pieces of data for each store: the type of store (pet or grocery), the time the store opens and the time the store closes. | |
// To simplify the opening and closing times, our stores will only open and close on the hour. The times will be stored in 24-hour format, so we will not be | |
// storing am or pm. For example, 7 am will be stored as 7. 7pm will be stored as 19 (because 12 + 7 = 19). | |
// If a store has been created, you can assume that the closing time is after the opening time (and no stores are open 24 hours a day). |
This file contains 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
/* Prompt the user for the number of coin flips. | |
Flip the count the designated number of times - displaying the number of the coin flip and the result | |
Display the number of coin heads and number of tails! | |
How many flips would you like? 4 | |
1. heads | |
2. tails | |
3. heads | |
4. heads |
This file contains 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 Coin | |
{ | |
//These are constants that are provided for your use. For example, using the constant "TAILS" is the same as typing a 1. | |
private final static int HEADS = 0; | |
private final static int TAILS = 1; | |
private final static int UNKNOWN = -1; | |
//ADD: private instance variables, type (String), year (int), face (int) | |
This file contains 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
/*global TWO_PI,vertex,CLOSE,abs,angleMode,append,background,beginShape,bezier,box,camera,ceil,CENTER,color,cone,cos,createCanvas,createCanvas,createGraphics,curveVertex,cylinder,DEGREES,displayHeight,displayWidth,dist,div,DOWN_ARROW,ellipse,endShape,fill,floor,frameCount,frameRate,height,image,key,keyCode,keyIsDown,keyIsPressed,keyIsPressed,keyPressed,LEFT,LEFT_ARROW,lerpColor,line,loadImage,loadJSON,loadSound,map,mouseIsPressed,mouseX,mouseY,noFill,noLoop,normalMaterial,noStroke,p5,plane,point,pointLight,pop,push,push,RADIANS,radians,random,rect,resizeCanvas,resizeCanvas,RIGHT,RIGHT_ARROW,rotate,rotateX,rotateY,rotateZ,round,round,scale,shuffle,sin,sphere,stroke,strokeWeight,text,textAlign,textFont,textSize,texture,textWidth,torus,translate,triangle,UP_ARROW,WEBGL,width,windowHeight,windowHeight,windowWidth,world */ | |
/*global currentLocation,room,item,currentLocation*/ | |
/*Create an HTML div and give it id="mymap"*/ | |
let myCanvas; | |
let mappy; | |
function setup(){ // only when game loads | |
myCanvas = createCanvas( |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ColorfulTables</title> | |
<style> | |
</style> | |
</head> | |
<body> |
This file contains 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
<html> | |
<head> | |
<title>Challenge: A picture-perfect trip</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<h1>The perfect trip</h1> | |
<p>I would see scenes like...</p> | |
This file contains 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 byteOverflow { | |
public static void main(String[] args) { | |
//System.out.println(Byte.MAX_VALUE); | |
//System.out.println(Byte.MIN_VALUE); | |
byte foo = 127; | |
foo++; | |
System.out.println(foo); | |
} |
This file contains 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
private void OnCollisionEnter2D(Collision2D coll){ | |
if (coll.transform.tag == "Player") { | |
var audioSource = GetComponent<AudioSource> (); | |
if (audioSource != null) { | |
audioSource.PlayOneShot (deathClip); | |
} | |
Instantiate(playerDeathPrefab, coll.contacts[0].point, Quaternion.identity); | |
sr.sprite = hitSprite; | |
//Destroy(coll.gameObject) | |
//GameManager.instance.RestartLevel (1.25f); |
This file contains 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 bool IsWallToLeftOrRight(){ | |
bool wallOnLeft = Physics2D.Raycast (new Vector2 (transform.position.x - width, transform.position.y), -Vector2.right, rayCastLengthCheck); | |
bool wallOnRight = Physics2D.Raycast (new Vector2 (transform.position.x + width, transform.position.y), Vector2.right, rayCastLengthCheck); | |
if (wallOnLeft || wallOnRight) | |
return true; | |
else | |
return false; | |
} |
This file contains 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 int GetWallDirection(){ | |
bool isWallLeft = Physics2D.Raycast (new Vector2 (transform.position.x - width, transform.position.y), -Vector2.right, rayCastLengthCheck); | |
bool isWallRight = Physics2D.Raycast (new Vector2 (transform.position.x + width, transform.position.y), Vector2.right, rayCastLengthCheck); | |
if (isWallLeft) | |
return -1; | |
else if(isWallRight) | |
return 1; | |
else | |
return 0; | |
} |