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
//this is a simple script that takes in two value, the product and sum of two numbers in a | |
//quadratic equation and tries to solve for the values to be used in solving the equation | |
function PpSp(p,s){ | |
big:for (var i=1;i<p;i++){ | |
for(var j=1;j<p;j++){ | |
if ((i*j)==p){ | |
if ((i+j)==s){ | |
// System.out.println("I got it. The numbers are "+i+" and "+j); |
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
package main; | |
import java.util.Scanner; | |
public class solverQE { | |
static double A, B, C; | |
public static void main(String[] args) { |
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
import java.awt.Component; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.ArrayList; | |
import javax.swing.*; | |
public class Board extends JPanel implements ActionListener, Runnable { | |
Dude 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 static String askQuestion(String question){ | |
Scanner ans=new Scanner(System.in); | |
String response; | |
do{ | |
System.out.println(question); | |
response=ans.next(); | |
}while(!response.equalsIgnoreCase("yes")||!response.equalsIgnoreCase("no")); | |
return response; |
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
#!/usr/bin/env python | |
import pyglet | |
mp3 = "test.mp3" | |
source = pyglet.media.load(mp3) | |
player = pyglet.media.Player() | |
player.queue(source) | |
player.play() |
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
import java.awt.*; | |
import javax.swing.ImageIcon; | |
public class Enemy { | |
Image img; | |
int x, y; | |
boolean isAlive = true; |
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
import java.awt.*; | |
import java.awt.event.KeyEvent; | |
import java.util.ArrayList; | |
import javax.swing.ImageIcon; | |
public class Dude { | |
int x, dx, y,nx,nx2,left, dy; | |
Image still,jump,reverse; |
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
import java.awt.*; | |
import javax.swing.ImageIcon; | |
public class Bullet { | |
int x,y; | |
Image img; | |
boolean visible; |
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
var color = '#'+(Math.random()*0xFFFFFF<<0).toString(16); | |
function changeBackground(color) { | |
document.body.style.background = color; | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer