使用Hashmap制作基于Java的抄袭检查器

时间:2017-04-16 23:55:10

标签: hashmap

它读取input.txt文件并与目标文件进行比较。 如果超过3个字与输入文件相同,程序应该说是剽窃。

我使用了子串,所以程序只比较前3个字母。

应该使用tokenized吗?或者它如何比较

这是我的代码

JFrame screen;

public void welcome(){  
      screen = new JFrame("Welcome");
      screen.setVisible(true);
      screen.pack();
      screen.setBackground(Color.darkGray);
      screen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);    
}

// in the original code there is series of methods here that eventually calls the drawBoard() method

public void drawBoard(){
try {
     final BufferedImage gboard = ImageIO.read(new File("cutsomGameBoard.jpg"));
     final BufferedImage featPanel = ImageIO.read(new File("extraPanel.png"));
     board = new JPanel(){
         protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(gboard, 0, 0, this);
            }
        };
    extra = new JPanel(){
        protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(featPanel, 0, 0, this);
            }
        };

        board.setSize(480, 480);
        extra.setSize(480, 320);

    }
    catch (IOException e) {
        e.printStackTrace();
    }
}

   gameScreen.add(toolbar, BorderLayout.PAGE_START);
   gameScreen.add(board, BorderLayout.EAST);
   gameScreen.add(extra, BorderLayout.WEST);
   gameScreen.setVisible(true);
   screen.add(gameScreen);
}

}

0 个答案:

没有答案