Skip to content
Snippets Groups Projects
Select Git revision
  • efed9d1ae304ce4047b14354a09a2ea6fcbb4ad6
  • master default
2 results

Fuzzer.java

  • Forked from Toby Murray / swen90006-a2-2020
    Up to date with the upstream repository.
    user avatar
    Toby Murray authored
    efed9d1a
    History
    Fuzzer.java 1.01 KiB
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.PrintWriter;
    
    
    /* a stub for your team's fuzzer */
    public class Fuzzer {
    
        private static final String OUTPUT_FILE = "fuzz.txt";
        
        public static void main(String[] args) throws IOException {
            System.out.println(Instruction.getBNF());
            FileOutputStream out = null;
            PrintWriter pw = null;
            try {
                out = new FileOutputStream(OUTPUT_FILE);
                pw = new PrintWriter(out);
                
                /* We just print one instruction.
                   Hint: you might want to make use of the instruction
                   grammar which is effectively encoded in Instruction.java */
                pw.println("list");
                
            }catch (Exception e){
                e.printStackTrace(System.err);
                System.exit(1);
            }finally{
                if (pw != null){
                    pw.flush();
                }
                if (out != null){
                    out.close();
                }
            }
    
        }
    
    }