Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws FileNotFoundException {
- System.out.println("Welcome to Flashcard Program vBeta/n" + "What you want to do?/n"
- + "/t1. Display a list of decks/n" + "/t2. Create a new deck/n"
- + "/t3. Set destination folder for flashcards (recommended for the first time)/n"
- + "/t4. What you want to be shown first in traditional view of flashbacks?");
- Scanner scan = new Scanner(System.in);
- int sc = scan.nextInt();
- if (sc == 1) {
- if (getLoc().equals("")) {
- System.out.println("Set the destination folder for the program");
- } else {
- System.out.println("Choose a deck");
- File f = new File(getLoc() + "\\flashcardList.txt");
- Scanner sf = new Scanner(f);
- int liczbalinijek = 0;
- while (sf.hasNextLine()) {
- liczbalinijek++;
- }
- String[] s = new String[liczbalinijek];
- for (int i = 0; sf.hasNextLine(); i++) {
- s[i] = sf.nextLine();
- System.out.println(s[i] + "/n");
- }
- if (s[0] == null) {
- System.out.println("There are no decks currentely created.");
- }
- Scanner dn = new Scanner(System.in);
- for (int i = 0; i < liczbalinijek; i++) {
- File d = new File(getLoc() + "\\" + s[i] + ".txt");
- Scanner fl = new Scanner(d);
- int ll = 0;
- if (s[i].equals(dn.toString())) {
- while (fl.hasNextLine())
- ll++;
- System.out.println(fl.nextLine() + "/n");
- System.out.println(
- "Options:" + "/n1. Switch to the traditional view." + "/n2. Launch a matching app");
- Scanner flashcard = new Scanner(System.in);
- int fc = flashcard.nextInt();
- if (fc == 1) {
- Flashcard[] fclist = new Flashcard[ll];
- Deck deck = new Deck(dn.toString(), fclist);
- deck.setFclist(d); // Napisać to pózniej
- int y = 0;
- if (getB()) {
- System.out.println(fclist[y].getTerm() + "/n");
- } else {
- System.out.println(fclist[y].getDefinition() + "/n");
- }
- if (y == 0)
- System.out.println("/t/tNext");
- else if (y == ll)
- System.out.println("Previous");
- else
- System.out.println("Previous/t/tNext");
- Scanner trview = new Scanner(System.in);
- if (trview.toString().equals("Previous"))
- y--;
- if (trview.toString().equals("Next"))
- y++;
- if (trview.toString().equals("Show the other"))
- if (getB()) {
- System.out.println("/n" + fclist[y].getDefinition() + "/n");
- } else {
- System.out.println("/n" + fclist[y].getTerm() + "/n");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement