Jump to content

Cowsay !

- - - - -

  • Please log in to reply
No replies to this topic

#1
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
I found this at pastebin and thought I could share it with you guys :)

Java pastebin - collaborative debugging tool

The source code is here !

import java.io.*;


public class Cowsay	{

	

	String cowsay;

	String dashLength="";

	BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));

	

	public void askInput() throws IOException	{

		cowsay=stdin.readLine();

		for(int i=0;i<cowsay.length();i++)	{

			dashLength=dashLength+("-");

		}

	}

public void printCow()	{

		

		System.out.println("--"+dashLength+"--");

		System.out.println("< "+cowsay+" >");

		System.out.println("--"+dashLength+"--");

        System.out.println("  |  ^__^");

        System.out.println("   - (oo)|_______");

        System.out.println("     (__)|       )/|/");

        System.out.println("         ||----w |");

        System.out.println("        ||     ||");

	}	

	public static void main(String[] args) throws IOException	{

		Cowsay c1 = new Cowsay();

		c1.askInput();

		c1.printCow();

	}

}

Credits goes to the rightful owner !
Posted Image




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users