Created
March 14, 2019 00:07
-
-
Save derka6391/de89c536ad26259f6e4edbb4e9527e79 to your computer and use it in GitHub Desktop.
used in derka.space for creating search bar.js file
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.*; | |
public class search_gen { | |
static void results(ArrayList<String> list) { | |
for (int i = 0; i < list.size(); i ++) { | |
System.out.println("\n\nelse if (searchitem.toLowerCase() == '" + list.get(i) + "')\n" + | |
"window.location.replace(\"\");"); | |
} // End For Loop | |
} // End results Functions | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
String search; | |
ArrayList<String> list = new ArrayList<>(); | |
boolean go = true; | |
while (go) { | |
System.out.print("\nenter new search result: "); | |
search = scan.nextLine(); | |
if (search.equals("1")) { | |
go = false; | |
search_gen.results(list); | |
} else { list.add(search); } | |
} // End While Loop | |
} // End Main | |
} // End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment