title: How to run a program on standard input?
body: <p>I've created an implementation of a Sokoban-solver and the code is currently looking like this (not going to post all the code):</p>
  
  <pre><code>public Sokoban() throws Exception{
  myList = new ArrayList&lt;Integer&gt;();
  
  file = new File("C:/Users/joaki/Desktop/sokoban/readin.txt");
  sc = new Scanner(file);
  sc.reset();
  List&lt;String&gt; lines = new ArrayList&lt;&gt;();
  while (sc.hasNextLine()) {
      line = sc.nextLine();
  </code></pre>
  
  <p>As you can see I'm just using the filepath to be able to read the file with a scanner, but according to my assignment, it should be looking like:</p>
  
  <blockquote>
    <p>To be more concrete if "map1.txt" is a file with a sokoban map your
    agent program "agent" will get map1.txt sent to in on standard input.
    Under unix/linux this corresponds to running the program like</p>
    
    <p><code>agent &lt; map1.txt</code></p>
  </blockquote>
  
  <p>I don't understand really what they mean, am I supposed to run the program from the command-line argument or from the cmd?</p>