Skip to content

Instantly share code, notes, and snippets.

@kylepls
Last active July 18, 2017 05:49
Show Gist options
  • Save kylepls/29add8a087697dac82ec15121e7d70e0 to your computer and use it in GitHub Desktop.
Save kylepls/29add8a087697dac82ec15121e7d70e0 to your computer and use it in GitHub Desktop.
Rewrote google in java. super ez.idk y they need 2 billion lines of code for this lmao
import java.util.Scanner;
class Main {
static String[] webpages =
new String[]{"google.com", "bing.com", "youtube.com", "youtube.biz", "spectonik.om"};
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Entier search: ");
String s = scanner.nextLine();
long start = System.currentTimeMillis();
int results = 0;
for (String webpage : webpages) {
if (webpage.contains(s)) {
System.out.println("Resutl " + s);
results++;
}
}
results*=100000 * Math.random();
System.out.println(
"Found " + results + " results in " + (System.currentTimeMillis() - start) + "ms");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment