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 TaxCalculator implements TaxLookup | |
{ | |
public static double getTax(int income, int status) | |
{ | |
double tax = 0; | |
for (int i = 0; i < 7; i++) | |
{ | |
if (income > lookup[status][i][1]) |
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 philyboyd_studge; | |
public class MinecraftChallenge { | |
public static void main(String[] args) { | |
World world = new World(); | |
world.updateWorld(); |
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.util.Random; | |
public class Game21 | |
{ | |
private int[] heap; | |
private Random rand = new Random(); | |
private boolean computerOpponent; | |
private boolean lastPlayWins; |
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
/* | |
* Generic Top-Down Merge Sort | |
* Based on this | |
* https://en.wikipedia.org/wiki/Merge_sort#Top-down_implementation_using_lists | |
* | |
* for http://www.reddit.com/r/javaexamples | |
* by user /u/Philboyd_Studge | |
* | |
* PUBLIC LICENSE - This software is released with an unlimited license. | |
* There is no specification of any kind on its usage or implementation. |
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.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Function; | |
import java.util.regex.PatternSyntaxException; |
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.util.ArrayList; | |
import java.util.List; | |
/** | |
* @author /u/Philboyd_Studge on 12/13/2015. | |
*/ | |
public class Advent14 { | |
List<Reindeer> deer = new ArrayList<>(); |
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.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.function.IntBinaryOperator; | |
/** | |
* @author /u/Philboyd_Studge on 12/6/2015. | |
*/ | |
public class Advent7 { |
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 util; | |
public class Coordinate { | |
private int row; | |
private int col; | |
public Coordinate(int row, int col) { | |
this.row = row; | |
this.col = col; | |
} |
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 enumexample; | |
import javax.swing.*; | |
import java.io.IOException; | |
import java.nio.file.*; | |
import java.nio.file.attribute.BasicFileAttributes; | |
/** | |
* @author /u/Philboyd_Studge on 1/10/2016. | |
*/ |
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 Inventory implements Comparable<Inventory> | |
{ | |
private String item; | |
private int qty; | |
private float price; | |
public Inventory(String item, int qty, float price) | |
{ | |
this.item = item; | |
this.qty = qty; |
OlderNewer