Last active
July 18, 2017 05:49
-
-
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
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; | |
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