Skip to content

Instantly share code, notes, and snippets.

@derka6391
Created March 14, 2019 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derka6391/de89c536ad26259f6e4edbb4e9527e79 to your computer and use it in GitHub Desktop.
Save derka6391/de89c536ad26259f6e4edbb4e9527e79 to your computer and use it in GitHub Desktop.
used in derka.space for creating search bar.js file
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