//File: lineFollow3.ic //Robust 04/18/2012 //Purpose: Brute force to have rover follow a line (~2.5 inches wide) code example

Example: //File: lineFollow3.ic //Robust 04/18/2012 //Purpose: Brute force to have rover follow a line (~2.5 inches wide)

/* package whatever; // don't place package name! */ import java.io.*; /* Name of the class has to be "Main" only if the class is public. */class Ideone{	public static void main (String[] args) throws java.lang.Exception	{		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));		String s;		while (!(s=r.readLine()).startsWith("42")) System.out.println(s);	}}

Tags:

Misc Example