Skip to content

Instantly share code, notes, and snippets.

@memish
Created October 2, 2018 00:52
Show Gist options
  • Save memish/c6b91106e1f72d649ee8972ebcab7476 to your computer and use it in GitHub Desktop.
Save memish/c6b91106e1f72d649ee8972ebcab7476 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
/**
* A simple class to run the Magpie class.
* @author Laurie White
* @version April 2012
*/
public class MagpieRunner2
{
/**
* Create a Magpie, give it user input, and print its replies.
*/
public static void main(String[] args)
{
Magpie2 maggie = new Magpie2();
System.out.println (maggie.getGreeting());
Scanner in = new Scanner (System.in);
String statement = in.nextLine();
while (!statement.equals("Bye"))
{
System.out.println (maggie.getResponse(statement));
statement = in.nextLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment