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 ( | |
"bufio" | |
"fmt" | |
"image" | |
"image/png" | |
"image/jpeg" | |
"io" | |
"os" |
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
# Variables and Lists | |
# =================== | |
board = [ | |
[" ", " ", " "], | |
[" ", " ", " "], | |
[" ", " ", " "] | |
] | |
playing = True | |
# Functions |
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 UselessJava.Day18; | |
public class Day18 { | |
public String detectCosmicRay(){ | |
final String[] comments = {"Why are you still here?", | |
"Most systems automatically fix errors caused by cosmic rays.", | |
"This is so stupid.", | |
"Based off of a reddit post by u/TripplerX.", | |
"I did nawt kill her, I did naaawt! Oh hai Mark.", | |
"The cheese stands alone, so sad :(", |
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 UselessJava.Day17; | |
import java.util.Scanner; | |
public class Day17 { | |
public String generateCheckerboard(int size){ | |
return generateCheckerboard(size, size); | |
} | |
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 UselessJava.Day16; | |
import java.util.Scanner; | |
public class Day16 { | |
public long sumOfString(String s){ | |
long sum = 0; | |
String[] strings = s.split("\\D"); | |
for(String string : strings) { | |
if(string.length() > 0) { |
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 UselessJava.Day15; | |
import java.util.Scanner; | |
public class Day15 { | |
public boolean hasHiddenRickRoll(String s){ | |
String test = s.replaceAll("[ \\t\\n]", ""); | |
String rickroll = "nevergonnagiveyouup"; | |
String regex = ".*"; | |
for(int i = 0; i < rickroll.length(); 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
package UselessJava.Day14; | |
import java.util.Scanner; | |
public class Day14 { | |
public String sortString(String s){ | |
char[] chars = s.toCharArray(); | |
quickSort(chars); | |
return String.valueOf(chars); | |
} |
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 UselessJava.Day13; | |
import java.util.Scanner; | |
public class Day13 { | |
public String decimalToFraction(double x){ | |
if(x == 0) return "0"; | |
if(x == (long)x) return Long.toString((long)x); | |
double n = Math.abs(x); | |
long d = 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 UselessJava.Day12; | |
import java.util.Scanner; | |
public class Day12 { | |
public String scared(String s){ | |
String[] strings = s.split("[ \\t\\n]"); | |
String res = ""; | |
for(String string : strings) { | |
double n = Math.random(); |
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 UselessJava.Day11; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Day11 { | |
NewerOlder