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 com.louishong; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.lang.reflect.Field; | |
public class ReadFile{ |
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.Scanner; | |
public class CharCheck { | |
public static void main(String[] args) { | |
Scanner keyboard = new Scanner(System.in); | |
System.out.println("Begin!"); | |
while (true) { | |
char input = keyboard.next().charAt(0); | |
if (isDigit(input)){ |
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 PrintOneOverN { | |
public static void main(String[] args) { | |
int finalDinominator = 20; | |
for (double i = 1; i <= finalDinominator; i++) { | |
System.out.println(1d/i); | |
} | |
} | |
} |
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.Scanner; | |
public class WhosTheBiggest { | |
public static void main(String[] args) { | |
Scanner keyboard = new Scanner(System.in); | |
while (true) { | |
Integer[] inputs = new Integer[3]; | |
System.out.println("Enter 3 positive digits"); | |
try { |
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.Scanner; | |
public class WhosTheBiggest { | |
public static void main(String[] args) { | |
Scanner keyboard = new Scanner(System.in); | |
while (true) { | |
Integer[] inputs = new Integer[3]; | |
System.out.println("Enter 3 positive digits"); | |
try { |
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.Scanner; | |
public class WhosTheBiggest { | |
public static void main(String[] args) { | |
Scanner keyboard = new Scanner(System.in); | |
mainLoop: | |
while (true) { | |
Integer[] inputs = new Integer[3]; |
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 PrintNumberTriangle{ | |
public static void main(String []args){ | |
int midNumber = 8; | |
for (int y = 1; y<=midNumber; y++) { | |
for (int x = 1; x<=y; x++) { | |
System.out.print(x + " "); | |
} | |
for (int space = 0; space<4*(midNumber-y)-2; space++) { | |
System.out.print(" "); |
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.Scanner; | |
public class AverageCalculator { | |
public static void main(String[] args) { | |
Scanner keyboard = new Scanner(System.in); | |
float sum = 0; | |
int count = 0; | |
mainLoop: while (true) { | |
System.out.print("Input a number, -1 to find average: "); |
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 re | |
# Engine | |
class Reddit2HTMLConverter: | |
def __init__(self, regPattern, formatStr, formatter): | |
self.regPattern = regPattern | |
self.formatter = formatter | |
self.formatStr = formatStr |
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
using UnityEngine; | |
public class PausableTimer { | |
private float _timerStart = -1; | |
private float _timerTime; | |
public PausableTimer(float initialTimerTime = 0) { | |
_timerTime = initialTimerTime; | |
} |
OlderNewer