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.*; | |
public class BlackJack { | |
private ArrayList<Card> hand1 = new ArrayList<Card>(); | |
private ArrayList<Card> hand2 = new ArrayList<Card>(); | |
private ArrayList<Card> hand3 = new ArrayList<Card>(); | |
Scanner Scan = new Scanner(System.in); | |
public void start() { | |
deal(); | |
System.out.print("\f"); |
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.io.*; | |
public class Character { | |
private String charName; | |
private String charRace; | |
private String gender; | |
private int age; | |
private String charClass; | |
private int strength; | |
private int constitution; | |
private int dexterity; |
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.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import java.util.*; | |
public class SwingJPanelDemo extends Frame implements ActionListener { | |
private JLabel labelUsername = new JLabel("Enter username: "); | |
private JLabel labelPassword = new JLabel("Enter password: "); | |
private JTextField textUsername = new JTextField(20); |
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
class MovingObj extends Object { | |
int xSpeed, ySpeed; | |
MovingObj() { | |
super(); | |
xSpeed = 1; | |
ySpeed = 1; | |
} | |
MovingObj(float inX, float inY, float inW, float inH, float inXSpeed, float inYSpeed) { | |
super(inX, inY, inW, inH) |
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.*; | |
public class BasetoBaseConverter { | |
public static void main(String[] args) { | |
Scanner Scan = new Scanner(System.in); | |
BasetoBaseConverter Run = new BasetoBaseConverter(); | |
System.out.println("\fWhat number would you like to convert?"); | |
String input = Scan.nextLine(); | |
String start = input; | |
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 NewtonMethod { | |
public static void main(String[] args) { | |
NewtonMethod test = new NewtonMethod(); | |
test.calc("4x^3 + 7x^2 + 5x + 6", -2, 5); | |
} | |
public void calc(String polynomial, double firstGuess, int tolerance) { | |
Polynomial p = new Polynomial(polynomial); | |
double newGuess; | |
double oldGuess = firstGuess; |
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 Location { | |
private double x; | |
private double y; | |
public Location() { | |
x = 0.0; | |
y = 0.0; | |
} | |
public Location(double x, double 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
public class NonConsecArray { | |
public int sum(int[] array) { | |
int Sum = 0; | |
int i = 0; | |
if (array.length%2 != 0) { | |
int iTemp = 2; | |
int tempSum = 0; | |
while (i < array.length) { | |
if (i + iTemp >= array.length - 1) { | |
iTemp++; |
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.Date; | |
import java.util.Random; | |
public class ArrayRepetitionFinder { | |
public static void main(String[] args) { | |
//int[] array = new int[100000000]; | |
Random rand = new Random(); | |
long[] times = new long[10]; | |
/*for (int i = 0; i < array.length; i++) { | |
array[i] = rand.nextInt(9) + 1; | |
}*/ |
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.Date; | |
public class Encryptor { | |
public static void main(String[] args) { | |
String check = ""; | |
for (int i = 0; i < 100000; i++) { | |
check += (char)(Math.random()*27 + 'a'); | |
} | |
Date start = new Date(); |
OlderNewer