Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 23.30 KB | None | 0 0
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.awt.*;
  5. import java.awt.event.*;
  6. import static java.lang.System.*;
  7.  
  8. public class memorize
  9. {
  10.     public static void main(String args[]) throws IOException
  11.     {
  12.        
  13.         Scanner kbin = new Scanner(System.in);
  14.         System.out.print("file name? >> ");
  15.         String filename = kbin.nextLine();
  16.         int lines=0;
  17.         Scanner scana = new Scanner(new File(filename.toString()));
  18.         System.out.println();
  19.         System.out.print("Reading "+filename+" ...");
  20.         while(scana.hasNextLine()==true)
  21.         {
  22.             scana.nextLine();
  23.             lines++;
  24.         }
  25.         Scanner scanb = new Scanner(new File(filename.toString()));
  26.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  27.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  28.         int askhow = scanb.nextInt();
  29.         int check = scanb.nextInt();
  30.         scanb.nextLine();
  31.         String[] ques = new String[lines-1];
  32.         String[] ans = new String[lines-1];
  33.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  34.         {
  35.             ques[fv1] = scanb.nextLine();
  36.             ans[fv1] = scanb.nextLine();
  37.         }
  38.         System.out.println("\n");
  39.         long asknum = 0;
  40.         long qoa = 0;
  41.         String disp = "";
  42.         String rans = "";
  43.         String userans = "";
  44.         for(;;)
  45.         {
  46.             asknum = Math.round(Math.random()*((lines-1)/2));
  47.             if(askhow==0)
  48.             {
  49.                 qoa = Math.round(Math.random());
  50.                 if(qoa==1)
  51.                 {
  52.                     disp = ans[(int)asknum];
  53.                     rans = ques[(int)asknum];
  54.                 }
  55.                 if(qoa==0)
  56.                 {
  57.                     disp = ques[(int)asknum];
  58.                     rans = ans[(int)asknum];
  59.                 }
  60.             }
  61.             if(askhow==1)
  62.             {
  63.                 disp = ques[(int)asknum];
  64.                 rans = ans[(int)asknum];
  65.             }
  66.             if(askhow==2)
  67.             {
  68.                 disp = ans[(int)asknum];
  69.                 rans = ques[(int)asknum];
  70.             }
  71.             System.out.print(disp+" >> ");
  72.             userans = kbin.nextLine();
  73.             if(check==1)
  74.             {
  75.                 if(userans.hashCode()==rans.hashCode())
  76.                 {
  77.                     System.out.println ("correct...");
  78.                 } else {
  79.                     System.out.println ("wrong... actually "+rans);
  80.                 }IM RETARDAED
  81.             } else {
  82.                 System.out.println ("answer is "+rans);
  83.             }
  84.             System.out.println ();
  85.         }
  86.  
  87.     }
  88. }import java.util.*;
  89. import java.lang.*;
  90. import java.io.*;
  91. import java.awt.*;
  92. import java.awt.event.*;
  93. import static java.lang.System.*;
  94.  
  95. public class memorize
  96. {
  97.     public static void main(String args[]) throws IOException
  98.     {
  99.        
  100.         Scanner kbin = new Scanner(System.in);
  101.         System.out.print("file name? >> ");
  102.         String filename = kbin.nextLine();
  103.         int lines=0;
  104.         Scanner scana = new Scanner(new File(filename.toString()));
  105.         System.out.println();
  106.         System.out.print("Reading "+filename+" ...");
  107.         while(scana.hasNextLine()==true)
  108.         {
  109.             scana.nextLine();
  110.             lines++;
  111.         }
  112.         Scanner scanb = new Scanner(new File(filename.toString()));
  113.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  114.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  115.         int askhow = scanb.nextInt();
  116.         int check = scanb.nextInt();
  117.         scanb.nextLine();
  118.         String[] ques = new String[lines-1];
  119.         String[] ans = new String[lines-1];
  120.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  121.         {
  122.             ques[fv1] = scanb.nextLine();
  123.             ans[fv1] = scanb.nextLine();
  124.         }
  125.         System.out.println("\n");
  126.         long asknum = 0;
  127.         long qoa = 0;
  128.         String disp = "";
  129.         String rans = "";
  130.         String userans = "";
  131.         for(;;)
  132.         {
  133.             asknum = Math.round(Math.random()*((lines-1)/2));
  134.             if(askhow==0)
  135.             {
  136.                 qoa = Math.round(Math.random());
  137.                 if(qoa==1)
  138.                 {
  139.                     disp = ans[(int)asknum];
  140.                     rans = ques[(int)asknum];
  141.                 }
  142.                 if(qoa==0)
  143.                 {
  144.                     disp = ques[(int)asknum];
  145.                     rans = ans[(int)asknum];
  146.                 }
  147.             }
  148.             if(askhow==1)
  149.             {
  150.                 disp = ques[(int)asknum];
  151.                 rans = ans[(int)asknum];
  152.             }
  153.             if(askhow==2)
  154.             {
  155.                 disp = ans[(int)asknum];
  156.                 rans = ques[(int)asknum];
  157.             }
  158.             System.out.print(disp+" >> ");
  159.             userans = kbin.nextLine();
  160.             if(check==1)
  161.             {
  162.                 if(userans.hashCode()==rans.hashCode())
  163.                 {
  164.                     System.out.println ("correct...");
  165.                 } else {
  166.                     System.out.println ("wrong... actually "+rans);
  167.                 }IM RETARDAED
  168.             } else {
  169.                 System.out.println ("answer is "+rans);
  170.             }
  171.             System.out.println ();
  172.         }
  173.  
  174.     }
  175. }import java.util.*;
  176. import java.lang.*;
  177. import java.io.*;
  178. import java.awt.*;
  179. import java.awt.event.*;
  180. import static java.lang.System.*;
  181.  
  182. public class memorize
  183. {
  184.     public static void main(String args[]) throws IOException
  185.     {
  186.        
  187.         Scanner kbin = new Scanner(System.in);
  188.         System.out.print("file name? >> ");
  189.         String filename = kbin.nextLine();
  190.         int lines=0;
  191.         Scanner scana = new Scanner(new File(filename.toString()));
  192.         System.out.println();
  193.         System.out.print("Reading "+filename+" ...");
  194.         while(scana.hasNextLine()==true)
  195.         {
  196.             scana.nextLine();
  197.             lines++;
  198.         }
  199.         Scanner scanb = new Scanner(new File(filename.toString()));
  200.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  201.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  202.         int askhow = scanb.nextInt();
  203.         int check = scanb.nextInt();
  204.         scanb.nextLine();
  205.         String[] ques = new String[lines-1];
  206.         String[] ans = new String[lines-1];
  207.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  208.         {
  209.             ques[fv1] = scanb.nextLine();
  210.             ans[fv1] = scanb.nextLine();
  211.         }
  212.         System.out.println("\n");
  213.         long asknum = 0;
  214.         long qoa = 0;
  215.         String disp = "";
  216.         String rans = "";
  217.         String userans = "";
  218.         for(;;)
  219.         {
  220.             asknum = Math.round(Math.random()*((lines-1)/2));
  221.             if(askhow==0)
  222.             {
  223.                 qoa = Math.round(Math.random());
  224.                 if(qoa==1)
  225.                 {
  226.                     disp = ans[(int)asknum];
  227.                     rans = ques[(int)asknum];
  228.                 }
  229.                 if(qoa==0)
  230.                 {
  231.                     disp = ques[(int)asknum];
  232.                     rans = ans[(int)asknum];
  233.                 }
  234.             }
  235.             if(askhow==1)
  236.             {
  237.                 disp = ques[(int)asknum];
  238.                 rans = ans[(int)asknum];
  239.             }
  240.             if(askhow==2)
  241.             {
  242.                 disp = ans[(int)asknum];
  243.                 rans = ques[(int)asknum];
  244.             }
  245.             System.out.print(disp+" >> ");
  246.             userans = kbin.nextLine();
  247.             if(check==1)
  248.             {
  249.                 if(userans.hashCode()==rans.hashCode())
  250.                 {
  251.                     System.out.println ("correct...");
  252.                 } else {
  253.                     System.out.println ("wrong... actually "+rans);
  254.                 }IM RETARDAED
  255.             } else {
  256.                 System.out.println ("answer is "+rans);
  257.             }
  258.             System.out.println ();
  259.         }
  260.  
  261.     }
  262. }import java.util.*;
  263. import java.lang.*;
  264. import java.io.*;
  265. import java.awt.*;
  266. import java.awt.event.*;
  267. import static java.lang.System.*;
  268.  
  269. public class memorize
  270. {
  271.     public static void main(String args[]) throws IOException
  272.     {
  273.        
  274.         Scanner kbin = new Scanner(System.in);
  275.         System.out.print("file name? >> ");
  276.         String filename = kbin.nextLine();
  277.         int lines=0;
  278.         Scanner scana = new Scanner(new File(filename.toString()));
  279.         System.out.println();
  280.         System.out.print("Reading "+filename+" ...");
  281.         while(scana.hasNextLine()==true)
  282.         {
  283.             scana.nextLine();
  284.             lines++;
  285.         }
  286.         Scanner scanb = new Scanner(new File(filename.toString()));
  287.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  288.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  289.         int askhow = scanb.nextInt();
  290.         int check = scanb.nextInt();
  291.         scanb.nextLine();
  292.         String[] ques = new String[lines-1];
  293.         String[] ans = new String[lines-1];
  294.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  295.         {
  296.             ques[fv1] = scanb.nextLine();
  297.             ans[fv1] = scanb.nextLine();
  298.         }
  299.         System.out.println("\n");
  300.         long asknum = 0;
  301.         long qoa = 0;
  302.         String disp = "";
  303.         String rans = "";
  304.         String userans = "";
  305.         for(;;)
  306.         {
  307.             asknum = Math.round(Math.random()*((lines-1)/2));
  308.             if(askhow==0)
  309.             {
  310.                 qoa = Math.round(Math.random());
  311.                 if(qoa==1)
  312.                 {
  313.                     disp = ans[(int)asknum];
  314.                     rans = ques[(int)asknum];
  315.                 }
  316.                 if(qoa==0)
  317.                 {
  318.                     disp = ques[(int)asknum];
  319.                     rans = ans[(int)asknum];
  320.                 }
  321.             }
  322.             if(askhow==1)
  323.             {
  324.                 disp = ques[(int)asknum];
  325.                 rans = ans[(int)asknum];
  326.             }
  327.             if(askhow==2)
  328.             {
  329.                 disp = ans[(int)asknum];
  330.                 rans = ques[(int)asknum];
  331.             }
  332.             System.out.print(disp+" >> ");
  333.             userans = kbin.nextLine();
  334.             if(check==1)
  335.             {
  336.                 if(userans.hashCode()==rans.hashCode())
  337.                 {
  338.                     System.out.println ("correct...");
  339.                 } else {
  340.                     System.out.println ("wrong... actually "+rans);
  341.                 }IM RETARDAED
  342.             } else {
  343.                 System.out.println ("answer is "+rans);
  344.             }
  345.             System.out.println ();
  346.         }
  347.  
  348.     }
  349. }import java.util.*;
  350. import java.lang.*;
  351. import java.io.*;
  352. import java.awt.*;
  353. import java.awt.event.*;
  354. import static java.lang.System.*;
  355.  
  356. public class memorize
  357. {
  358.     public static void main(String args[]) throws IOException
  359.     {
  360.        
  361.         Scanner kbin = new Scanner(System.in);
  362.         System.out.print("file name? >> ");
  363.         String filename = kbin.nextLine();
  364.         int lines=0;
  365.         Scanner scana = new Scanner(new File(filename.toString()));
  366.         System.out.println();
  367.         System.out.print("Reading "+filename+" ...");
  368.         while(scana.hasNextLine()==true)
  369.         {
  370.             scana.nextLine();
  371.             lines++;
  372.         }
  373.         Scanner scanb = new Scanner(new File(filename.toString()));
  374.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  375.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  376.         int askhow = scanb.nextInt();
  377.         int check = scanb.nextInt();
  378.         scanb.nextLine();
  379.         String[] ques = new String[lines-1];
  380.         String[] ans = new String[lines-1];
  381.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  382.         {
  383.             ques[fv1] = scanb.nextLine();
  384.             ans[fv1] = scanb.nextLine();
  385.         }
  386.         System.out.println("\n");
  387.         long asknum = 0;
  388.         long qoa = 0;
  389.         String disp = "";
  390.         String rans = "";
  391.         String userans = "";
  392.         for(;;)
  393.         {
  394.             asknum = Math.round(Math.random()*((lines-1)/2));
  395.             if(askhow==0)
  396.             {
  397.                 qoa = Math.round(Math.random());
  398.                 if(qoa==1)
  399.                 {
  400.                     disp = ans[(int)asknum];
  401.                     rans = ques[(int)asknum];
  402.                 }
  403.                 if(qoa==0)
  404.                 {
  405.                     disp = ques[(int)asknum];
  406.                     rans = ans[(int)asknum];
  407.                 }
  408.             }
  409.             if(askhow==1)
  410.             {
  411.                 disp = ques[(int)asknum];
  412.                 rans = ans[(int)asknum];
  413.             }
  414.             if(askhow==2)
  415.             {
  416.                 disp = ans[(int)asknum];
  417.                 rans = ques[(int)asknum];
  418.             }
  419.             System.out.print(disp+" >> ");
  420.             userans = kbin.nextLine();
  421.             if(check==1)
  422.             {
  423.                 if(userans.hashCode()==rans.hashCode())
  424.                 {
  425.                     System.out.println ("correct...");
  426.                 } else {
  427.                     System.out.println ("wrong... actually "+rans);
  428.                 }IM RETARDAED
  429.             } else {
  430.                 System.out.println ("answer is "+rans);
  431.             }
  432.             System.out.println ();
  433.         }
  434.  
  435.     }
  436. }import java.util.*;
  437. import java.lang.*;
  438. import java.io.*;
  439. import java.awt.*;
  440. import java.awt.event.*;
  441. import static java.lang.System.*;
  442.  
  443. public class memorize
  444. {
  445.     public static void main(String args[]) throws IOException
  446.     {
  447.        
  448.         Scanner kbin = new Scanner(System.in);
  449.         System.out.print("file name? >> ");
  450.         String filename = kbin.nextLine();
  451.         int lines=0;
  452.         Scanner scana = new Scanner(new File(filename.toString()));
  453.         System.out.println();
  454.         System.out.print("Reading "+filename+" ...");
  455.         while(scana.hasNextLine()==true)
  456.         {
  457.             scana.nextLine();
  458.             lines++;
  459.         }
  460.         Scanner scanb = new Scanner(new File(filename.toString()));
  461.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  462.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  463.         int askhow = scanb.nextInt();
  464.         int check = scanb.nextInt();
  465.         scanb.nextLine();
  466.         String[] ques = new String[lines-1];
  467.         String[] ans = new String[lines-1];
  468.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  469.         {
  470.             ques[fv1] = scanb.nextLine();
  471.             ans[fv1] = scanb.nextLine();
  472.         }
  473.         System.out.println("\n");
  474.         long asknum = 0;
  475.         long qoa = 0;
  476.         String disp = "";
  477.         String rans = "";
  478.         String userans = "";
  479.         for(;;)
  480.         {
  481.             asknum = Math.round(Math.random()*((lines-1)/2));
  482.             if(askhow==0)
  483.             {
  484.                 qoa = Math.round(Math.random());
  485.                 if(qoa==1)
  486.                 {
  487.                     disp = ans[(int)asknum];
  488.                     rans = ques[(int)asknum];
  489.                 }
  490.                 if(qoa==0)
  491.                 {
  492.                     disp = ques[(int)asknum];
  493.                     rans = ans[(int)asknum];
  494.                 }
  495.             }
  496.             if(askhow==1)
  497.             {
  498.                 disp = ques[(int)asknum];
  499.                 rans = ans[(int)asknum];
  500.             }
  501.             if(askhow==2)
  502.             {
  503.                 disp = ans[(int)asknum];
  504.                 rans = ques[(int)asknum];
  505.             }
  506.             System.out.print(disp+" >> ");
  507.             userans = kbin.nextLine();
  508.             if(check==1)
  509.             {
  510.                 if(userans.hashCode()==rans.hashCode())
  511.                 {
  512.                     System.out.println ("correct...");
  513.                 } else {
  514.                     System.out.println ("wrong... actually "+rans);
  515.                 }IM RETARDAED
  516.             } else {
  517.                 System.out.println ("answer is "+rans);
  518.             }
  519.             System.out.println ();
  520.         }
  521.  
  522.     }
  523. }import java.util.*;
  524. import java.lang.*;
  525. import java.io.*;
  526. import java.awt.*;
  527. import java.awt.event.*;
  528. import static java.lang.System.*;
  529.  
  530. public class memorize
  531. {
  532.     public static void main(String args[]) throws IOException
  533.     {
  534.        
  535.         Scanner kbin = new Scanner(System.in);
  536.         System.out.print("file name? >> ");
  537.         String filename = kbin.nextLine();
  538.         int lines=0;
  539.         Scanner scana = new Scanner(new File(filename.toString()));
  540.         System.out.println();
  541.         System.out.print("Reading "+filename+" ...");
  542.         while(scana.hasNextLine()==true)
  543.         {
  544.             scana.nextLine();
  545.             lines++;
  546.         }
  547.         Scanner scanb = new Scanner(new File(filename.toString()));
  548.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  549.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  550.         int askhow = scanb.nextInt();
  551.         int check = scanb.nextInt();
  552.         scanb.nextLine();
  553.         String[] ques = new String[lines-1];
  554.         String[] ans = new String[lines-1];
  555.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  556.         {
  557.             ques[fv1] = scanb.nextLine();
  558.             ans[fv1] = scanb.nextLine();
  559.         }
  560.         System.out.println("\n");
  561.         long asknum = 0;
  562.         long qoa = 0;
  563.         String disp = "";
  564.         String rans = "";
  565.         String userans = "";
  566.         for(;;)
  567.         {
  568.             asknum = Math.round(Math.random()*((lines-1)/2));
  569.             if(askhow==0)
  570.             {
  571.                 qoa = Math.round(Math.random());
  572.                 if(qoa==1)
  573.                 {
  574.                     disp = ans[(int)asknum];
  575.                     rans = ques[(int)asknum];
  576.                 }
  577.                 if(qoa==0)
  578.                 {
  579.                     disp = ques[(int)asknum];
  580.                     rans = ans[(int)asknum];
  581.                 }
  582.             }
  583.             if(askhow==1)
  584.             {
  585.                 disp = ques[(int)asknum];
  586.                 rans = ans[(int)asknum];
  587.             }
  588.             if(askhow==2)
  589.             {
  590.                 disp = ans[(int)asknum];
  591.                 rans = ques[(int)asknum];
  592.             }
  593.             System.out.print(disp+" >> ");
  594.             userans = kbin.nextLine();
  595.             if(check==1)
  596.             {
  597.                 if(userans.hashCode()==rans.hashCode())
  598.                 {
  599.                     System.out.println ("correct...");
  600.                 } else {
  601.                     System.out.println ("wrong... actually "+rans);
  602.                 }IM RETARDAED
  603.             } else {
  604.                 System.out.println ("answer is "+rans);
  605.             }
  606.             System.out.println ();
  607.         }
  608.  
  609.     }
  610. }import java.util.*;
  611. import java.lang.*;
  612. import java.io.*;
  613. import java.awt.*;
  614. import java.awt.event.*;
  615. import static java.lang.System.*;
  616.  
  617. public class memorize
  618. {
  619.     public static void main(String args[]) throws IOException
  620.     {
  621.        
  622.         Scanner kbin = new Scanner(System.in);
  623.         System.out.print("file name? >> ");
  624.         String filename = kbin.nextLine();
  625.         int lines=0;
  626.         Scanner scana = new Scanner(new File(filename.toString()));
  627.         System.out.println();
  628.         System.out.print("Reading "+filename+" ...");
  629.         while(scana.hasNextLine()==true)
  630.         {
  631.             scana.nextLine();
  632.             lines++;
  633.         }
  634.         Scanner scanb = new Scanner(new File(filename.toString()));
  635.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  636.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  637.         int askhow = scanb.nextInt();
  638.         int check = scanb.nextInt();
  639.         scanb.nextLine();
  640.         String[] ques = new String[lines-1];
  641.         String[] ans = new String[lines-1];
  642.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  643.         {
  644.             ques[fv1] = scanb.nextLine();
  645.             ans[fv1] = scanb.nextLine();
  646.         }
  647.         System.out.println("\n");
  648.         long asknum = 0;
  649.         long qoa = 0;
  650.         String disp = "";
  651.         String rans = "";
  652.         String userans = "";
  653.         for(;;)
  654.         {
  655.             asknum = Math.round(Math.random()*((lines-1)/2));
  656.             if(askhow==0)
  657.             {
  658.                 qoa = Math.round(Math.random());
  659.                 if(qoa==1)
  660.                 {
  661.                     disp = ans[(int)asknum];
  662.                     rans = ques[(int)asknum];
  663.                 }
  664.                 if(qoa==0)
  665.                 {
  666.                     disp = ques[(int)asknum];
  667.                     rans = ans[(int)asknum];
  668.                 }
  669.             }
  670.             if(askhow==1)
  671.             {
  672.                 disp = ques[(int)asknum];
  673.                 rans = ans[(int)asknum];
  674.             }
  675.             if(askhow==2)
  676.             {
  677.                 disp = ans[(int)asknum];
  678.                 rans = ques[(int)asknum];
  679.             }
  680.             System.out.print(disp+" >> ");
  681.             userans = kbin.nextLine();
  682.             if(check==1)
  683.             {
  684.                 if(userans.hashCode()==rans.hashCode())
  685.                 {
  686.                     System.out.println ("correct...");
  687.                 } else {
  688.                     System.out.println ("wrong... actually "+rans);
  689.                 }IM RETARDAED
  690.             } else {
  691.                 System.out.println ("answer is "+rans);
  692.             }
  693.             System.out.println ();
  694.         }
  695.  
  696.     }
  697. }import java.util.*;
  698. import java.lang.*;
  699. import java.io.*;
  700. import java.awt.*;
  701. import java.awt.event.*;
  702. import static java.lang.System.*;
  703.  
  704. public class memorize
  705. {
  706.     public static void main(String args[]) throws IOException
  707.     {
  708.        
  709.         Scanner kbin = new Scanner(System.in);
  710.         System.out.print("file name? >> ");
  711.         String filename = kbin.nextLine();
  712.         int lines=0;
  713.         Scanner scana = new Scanner(new File(filename.toString()));
  714.         System.out.println();
  715.         System.out.print("Reading "+filename+" ...");
  716.         while(scana.hasNextLine()==true)
  717.         {
  718.             scana.nextLine();
  719.             lines++;
  720.         }
  721.         Scanner scanb = new Scanner(new File(filename.toString()));
  722.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  723.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  724.         int askhow = scanb.nextInt();
  725.         int check = scanb.nextInt();
  726.         scanb.nextLine();
  727.         String[] ques = new String[lines-1];
  728.         String[] ans = new String[lines-1];
  729.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  730.         {
  731.             ques[fv1] = scanb.nextLine();
  732.             ans[fv1] = scanb.nextLine();
  733.         }
  734.         System.out.println("\n");
  735.         long asknum = 0;
  736.         long qoa = 0;
  737.         String disp = "";
  738.         String rans = "";
  739.         String userans = "";
  740.         for(;;)
  741.         {
  742.             asknum = Math.round(Math.random()*((lines-1)/2));
  743.             if(askhow==0)
  744.             {
  745.                 qoa = Math.round(Math.random());
  746.                 if(qoa==1)
  747.                 {
  748.                     disp = ans[(int)asknum];
  749.                     rans = ques[(int)asknum];
  750.                 }
  751.                 if(qoa==0)
  752.                 {
  753.                     disp = ques[(int)asknum];
  754.                     rans = ans[(int)asknum];
  755.                 }
  756.             }
  757.             if(askhow==1)
  758.             {
  759.                 disp = ques[(int)asknum];
  760.                 rans = ans[(int)asknum];
  761.             }
  762.             if(askhow==2)
  763.             {
  764.                 disp = ans[(int)asknum];
  765.                 rans = ques[(int)asknum];
  766.             }
  767.             System.out.print(disp+" >> ");
  768.             userans = kbin.nextLine();
  769.             if(check==1)
  770.             {
  771.                 if(userans.hashCode()==rans.hashCode())
  772.                 {
  773.                     System.out.println ("correct...");
  774.                 } else {
  775.                     System.out.println ("wrong... actually "+rans);
  776.                 }IM RETARDAED
  777.             } else {
  778.                 System.out.println ("answer is "+rans);
  779.             }
  780.             System.out.println ();
  781.         }
  782.  
  783.     }
  784. }import java.util.*;
  785. import java.lang.*;
  786. import java.io.*;
  787. import java.awt.*;
  788. import java.awt.event.*;
  789. import static java.lang.System.*;
  790.  
  791. public class memorize
  792. {
  793.     public static void main(String args[]) throws IOException
  794.     {
  795.        
  796.         Scanner kbin = new Scanner(System.in);
  797.         System.out.print("file name? >> ");
  798.         String filename = kbin.nextLine();
  799.         int lines=0;
  800.         Scanner scana = new Scanner(new File(filename.toString()));
  801.         System.out.println();
  802.         System.out.print("Reading "+filename+" ...");
  803.         while(scana.hasNextLine()==true)
  804.         {
  805.             scana.nextLine();
  806.             lines++;
  807.         }
  808.         Scanner scanb = new Scanner(new File(filename.toString()));
  809.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  810.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  811.         int askhow = scanb.nextInt();
  812.         int check = scanb.nextInt();
  813.         scanb.nextLine();
  814.         String[] ques = new String[lines-1];
  815.         String[] ans = new String[lines-1];
  816.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  817.         {
  818.             ques[fv1] = scanb.nextLine();
  819.             ans[fv1] = scanb.nextLine();
  820.         }
  821.         System.out.println("\n");
  822.         long asknum = 0;
  823.         long qoa = 0;
  824.         String disp = "";
  825.         String rans = "";
  826.         String userans = "";
  827.         for(;;)
  828.         {
  829.             asknum = Math.round(Math.random()*((lines-1)/2));
  830.             if(askhow==0)
  831.             {
  832.                 qoa = Math.round(Math.random());
  833.                 if(qoa==1)
  834.                 {
  835.                     disp = ans[(int)asknum];
  836.                     rans = ques[(int)asknum];
  837.                 }
  838.                 if(qoa==0)
  839.                 {
  840.                     disp = ques[(int)asknum];
  841.                     rans = ans[(int)asknum];
  842.                 }
  843.             }
  844.             if(askhow==1)
  845.             {
  846.                 disp = ques[(int)asknum];
  847.                 rans = ans[(int)asknum];
  848.             }
  849.             if(askhow==2)
  850.             {
  851.                 disp = ans[(int)asknum];
  852.                 rans = ques[(int)asknum];
  853.             }
  854.             System.out.print(disp+" >> ");
  855.             userans = kbin.nextLine();
  856.             if(check==1)
  857.             {
  858.                 if(userans.hashCode()==rans.hashCode())
  859.                 {
  860.                     System.out.println ("correct...");
  861.                 } else {
  862.                     System.out.println ("wrong... actually "+rans);
  863.                 }IM RETARDAED
  864.             } else {
  865.                 System.out.println ("answer is "+rans);
  866.             }
  867.             System.out.println ();
  868.         }
  869.  
  870.     }
  871. }import java.util.*;
  872. import java.lang.*;
  873. import java.io.*;
  874. import java.awt.*;
  875. import java.awt.event.*;
  876. import static java.lang.System.*;
  877.  
  878. public class memorize
  879. {
  880.     public static void main(String args[]) throws IOException
  881.     {
  882.        
  883.         Scanner kbin = new Scanner(System.in);
  884.         System.out.print("file name? >> ");
  885.         String filename = kbin.nextLine();
  886.         int lines=0;
  887.         Scanner scana = new Scanner(new File(filename.toString()));
  888.         System.out.println();
  889.         System.out.print("Reading "+filename+" ...");
  890.         while(scana.hasNextLine()==true)
  891.         {
  892.             scana.nextLine();
  893.             lines++;
  894.         }
  895.         Scanner scanb = new Scanner(new File(filename.toString()));
  896.         /* in mem.txt, on the first line, the first integer is how to ask, where 0 = ask both, 1 = ask first, and 2 = ask second.
  897.            the second integer is to check with typing in the answer or not, 1=true, 0=false. */
  898.         int askhow = scanb.nextInt();
  899.         int check = scanb.nextInt();
  900.         scanb.nextLine();
  901.         String[] ques = new String[lines-1];
  902.         String[] ans = new String[lines-1];
  903.         for(int fv1 = 0; fv1 < (lines-1)/2; fv1++)
  904.         {
  905.             ques[fv1] = scanb.nextLine();
  906.             ans[fv1] = scanb.nextLine();
  907.         }
  908.         System.out.println("\n");
  909.         long asknum = 0;
  910.         long qoa = 0;
  911.         String disp = "";
  912.         String rans = "";
  913.         String userans = "";
  914.         for(;;)
  915.         {
  916.             asknum = Math.round(Math.random()*((lines-1)/2));
  917.             if(askhow==0)
  918.             {
  919.                 qoa = Math.round(Math.random());
  920.                 if(qoa==1)
  921.                 {
  922.                     disp = ans[(int)asknum];
  923.                     rans = ques[(int)asknum];
  924.                 }
  925.                 if(qoa==0)
  926.                 {
  927.                     disp = ques[(int)asknum];
  928.                     rans = ans[(int)asknum];
  929.                 }
  930.             }
  931.             if(askhow==1)
  932.             {
  933.                 disp = ques[(int)asknum];
  934.                 rans = ans[(int)asknum];
  935.             }
  936.             if(askhow==2)
  937.             {
  938.                 disp = ans[(int)asknum];
  939.                 rans = ques[(int)asknum];
  940.             }
  941.             System.out.print(disp+" >> ");
  942.             userans = kbin.nextLine();
  943.             if(check==1)
  944.             {
  945.                 if(userans.hashCode()==rans.hashCode())
  946.                 {
  947.                     System.out.println ("correct...");
  948.                 } else {
  949.                     System.out.println ("wrong... actually "+rans);
  950.                 }IM RETARDAED
  951.             } else {
  952.                 System.out.println ("answer is "+rans);
  953.             }
  954.             System.out.println ();
  955.         }
  956.  
  957.     }
  958. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement