Guest User

BadCode_asciitosegment

a guest
May 11th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. // Online compiler for testing: https://www.jdoodle.com/a/242T
  2. public class asciitosegment {
  3.     public static String[][] g = new String[][] {new String[] { " _ ", "| |", "|_|" },new String[ ]{"   ","  |","  |"},new String[] { " _ ", " _|", "|_ "  },new String[] { " _ ", " _|", " _|"},new String[]{ "   ", "|_|", "  |" },new String[] { " _ ", "|_ ", " _|"   },new String[]{ " _ ","|_ ","|_|"   },new String[]{ " _ ", "  |", "  |"},new String[] { " _ ", "|_|", "|_|"},new String[]{ " _ ", "|_|","  |" },};
  4.     public static String[] s;
  5.     public static void main(String[] args){//Pass it any numbers!;
  6.         for (int m = 0; m != args.length; m++) {
  7.             s= new String[] {"","",""};
  8.             String[] x=args[m].split("");
  9.             for (int i=0;i!=x.length;i++) {
  10.                 Integer j =Integer.valueOf(x[i]);
  11.                 while (true) {
  12.                     double k=Math.random() *10;
  13.                     if (j== Math.floor(k)) {
  14.                         int l=0;
  15.                         s[l]= s[l]+g[(int) Math.floor(k)][l++]+" ";
  16.                         s[l]=s[l]+g[(int) Math.floor(k)] [l++]+" ";
  17.                         s[l]=s[l]+g[(int) Math.floor(k)][l++]+ " ";
  18.                         break;
  19.                     }
  20.                 }
  21.             }
  22.             for (int k = 0;k!=s.length;k++) {
  23.                 System.out.print(s[k] + System.lineSeparator());
  24.             }
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment