Skip to main content
deleted 33 characters in body
Source Link

Java - 921 907907 863 characters

public class D{public static void main(String[]a){char[]z=a[0].toCharArray();char[]y=new char[3];y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N';int o=(y[0]=='N')?0:1;y[1]=z[o++];y[2]=z.length>o?z[o]:'!';int n=y[1]<'C'?((int)(y[1]-'A'))+6:((int)(y[1]-'C'))+1;n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n);String s="     ";String b=" --- ";String[]out=new";String[]u=new String[22];for(int i=1;i<=21;i+=2){out[i]=s;u[i]=s;}for(int i=10;i<=18;i+=2){out[i]="u[i]="-----";}out[20]=n>19u[20]=n>19?b:s;out[2]=n<3s;u[2]=n<3?b:s;out[4]=n<5s;u[4]=n<5?b:s;out[6]=n<7s;u[6]=n<7?b:s;out[8]=n<9s;u[8]=n<9?b:s;char c=out[n]c=u[n].charAt(0);char e=out[n]e=u[n].charAt(1);char[]h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c};out[n]=new;u[n]=new String(h);for(int i=0;i<22;i++){if(n<14&&i-n<4&&i>n)out[i]=out[i]u[i]=u[i]!=null?out[i]u[i].substring(0,3)+"|"+out[i]+"|"+u[i].charAt(4):s;else if(n>13&&n-i<4&&n>i)out[i]=out[i]u[i]=u[i]!=null?out[i]u[i].substring(0,3)+"|"+out[i]+"|"+u[i].charAt(4):s;}for(int i=21;i>=0;i--)if(!(i>n&&i>18||i<n&&i<10))System.outu.println((out[i]==nullu[i]==null)?s:out[i]u[i]);}}

Java - 921 907 characters

public class D{public static void main(String[]a){char[]z=a[0].toCharArray();char[]y=new char[3];y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N';int o=(y[0]=='N')?0:1;y[1]=z[o++];y[2]=z.length>o?z[o]:'!';int n=y[1]<'C'?((int)(y[1]-'A'))+6:((int)(y[1]-'C'))+1;n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n);String s="     ";String b=" --- ";String[]out=new String[22];for(int i=1;i<=21;i+=2){out[i]=s;}for(int i=10;i<=18;i+=2){out[i]="-----";}out[20]=n>19?b:s;out[2]=n<3?b:s;out[4]=n<5?b:s;out[6]=n<7?b:s;out[8]=n<9?b:s;char c=out[n].charAt(0);char e=out[n].charAt(1);char[]h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c};out[n]=new String(h);for(int i=0;i<22;i++){if(n<14&&i-n<4&&i>n)out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;else if(n>13&&n-i<4&&n>i)out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;}for(int i=21;i>=0;i--)if(!(i>n&&i>18||i<n&&i<10))System.out.println((out[i]==null)?s:out[i]);}}

Java - 921 907 863 characters

public class D{public static void main(String[]a){char[]z=a[0].toCharArray();char[]y=new char[3];y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N';int o=(y[0]=='N')?0:1;y[1]=z[o++];y[2]=z.length>o?z[o]:'!';int n=y[1]<'C'?((int)(y[1]-'A'))+6:((int)(y[1]-'C'))+1;n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n);String s="     ";String b=" --- ";String[]u=new String[22];for(int i=1;i<=21;i+=2){u[i]=s;}for(int i=10;i<=18;i+=2){u[i]="-----";}u[20]=n>19?b:s;u[2]=n<3?b:s;u[4]=n<5?b:s;u[6]=n<7?b:s;u[8]=n<9?b:s;char c=u[n].charAt(0);char e=u[n].charAt(1);char[]h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c};u[n]=new String(h);for(int i=0;i<22;i++){if(n<14&&i-n<4&&i>n)u[i]=u[i]!=null?u[i].substring(0,3)+"|"+u[i].charAt(4):s;else if(n>13&&n-i<4&&n>i)u[i]=u[i]!=null?u[i].substring(0,3)+"|"+u[i].charAt(4):s;}for(int i=21;i>=0;i--)if(!(i>n&&i>18||i<n&&i<10))System.u.println((u[i]==null)?s:u[i]);}}
Removed some spaces
Source Link

Java - 921921 907 characters

public class D{public static void main(String[] argsString[]a){char[] z=args[0]char[]z=a[0].toCharArray(); char[] y=new char[3];;char[]y=new y[0]=char[3];y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N'; int'N';int o=(y[0]=='N')?0:1; y[1]=z[o++]; y[2]=z1;y[1]=z[o++];y[2]=z.length>o?z[o]:'!'; int';int n=y[1]<'C'?((int) (y[1] - 'A')) + 6+6:((int) (y[1] - 'C')) + 1; n=+1;n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n); String;String s="     "; String";String b=" --- "; String[] q=new String[22]; for";String[]out=new String[22];for(int i=1;i<=21;i+=2){q[i]=s;out[i]=s;} for (int i=10;i<=18;i+=2){q[i]="out[i]="-----";} q[20]=n>19out[20]=n>19?b:s; q[2]=n<3s;out[2]=n<3?b:s; q[4]=n<5s;out[4]=n<5?b:s; q[6]=n<7s;out[6]=n<7?b:s; q[8]=n<9s;out[8]=n<9?b:s; chars;char c=q[n]c=out[n].charAt(0); char;char e=q[n]e=out[n].charAt(1); char[] h=new;char[]h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c}; q[n]=new;out[n]=new String(h); for ;for(int i=0;i<22;i++){if (n<14&&i-n<4&&i>n) q[i]=q[i]out[i]=out[i]!=null?q[i]out[i].substring(0,3)+"|"+q[i]+"|"+out[i].charAt(4):s; elses;else if (n>13&&n-i<4&&n>i) q[i]=q[i]out[i]=out[i]!=null?q[i]out[i].substring(0,3)+"|"+q[i]+"|"+out[i].charAt(4):s;} for (int i=21;i>=0;i--) if (!(i>n&&i>18||i<n&&i<10)) System.out.println((q[i]==nullout[i]==null)?s:q[i]out[i]);}}

Java - 921 characters

public class D{public static void main(String[] args){char[] z=args[0].toCharArray(); char[] y=new char[3]; y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N'; int o=(y[0]=='N')?0:1; y[1]=z[o++]; y[2]=z.length>o?z[o]:'!'; int n=y[1]<'C'?((int) (y[1] - 'A')) + 6:((int) (y[1] - 'C')) + 1; n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n); String s="     "; String b=" --- "; String[] q=new String[22]; for (int i=1;i<=21;i+=2){q[i]=s;} for (int i=10;i<=18;i+=2){q[i]="-----";} q[20]=n>19?b:s; q[2]=n<3?b:s; q[4]=n<5?b:s; q[6]=n<7?b:s; q[8]=n<9?b:s; char c=q[n].charAt(0); char e=q[n].charAt(1); char[] h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c}; q[n]=new String(h); for (int i=0;i<22;i++){if (n<14&&i-n<4&&i>n) q[i]=q[i]!=null?q[i].substring(0,3)+"|"+q[i].charAt(4):s; else if (n>13&&n-i<4&&n>i) q[i]=q[i]!=null?q[i].substring(0,3)+"|"+q[i].charAt(4):s;} for (int i=21;i>=0;i--) if (!(i>n&&i>18||i<n&&i<10)) System.out.println((q[i]==null)?s:q[i]);}}

Java - 921 907 characters

public class D{public static void main(String[]a){char[]z=a[0].toCharArray();char[]y=new char[3];y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N';int o=(y[0]=='N')?0:1;y[1]=z[o++];y[2]=z.length>o?z[o]:'!';int n=y[1]<'C'?((int)(y[1]-'A'))+6:((int)(y[1]-'C'))+1;n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n);String s="     ";String b=" --- ";String[]out=new String[22];for(int i=1;i<=21;i+=2){out[i]=s;}for(int i=10;i<=18;i+=2){out[i]="-----";}out[20]=n>19?b:s;out[2]=n<3?b:s;out[4]=n<5?b:s;out[6]=n<7?b:s;out[8]=n<9?b:s;char c=out[n].charAt(0);char e=out[n].charAt(1);char[]h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c};out[n]=new String(h);for(int i=0;i<22;i++){if(n<14&&i-n<4&&i>n)out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;else if(n>13&&n-i<4&&n>i)out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;}for(int i=21;i>=0;i--)if(!(i>n&&i>18||i<n&&i<10))System.out.println((out[i]==null)?s:out[i]);}}
Source Link

Java - 921 characters

I build up each string seperately, storing each string in an array. Then loop through the array and print out each line.

public class D{public static void main(String[] args){char[] z=args[0].toCharArray(); char[] y=new char[3]; y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N'; int o=(y[0]=='N')?0:1; y[1]=z[o++]; y[2]=z.length>o?z[o]:'!'; int n=y[1]<'C'?((int) (y[1] - 'A')) + 6:((int) (y[1] - 'C')) + 1; n=(y[0]=='N')?n+7:(y[0]=='H'?n+14:n); String s="     "; String b=" --- "; String[] q=new String[22]; for (int i=1;i<=21;i+=2){q[i]=s;} for (int i=10;i<=18;i+=2){q[i]="-----";} q[20]=n>19?b:s; q[2]=n<3?b:s; q[4]=n<5?b:s; q[6]=n<7?b:s; q[8]=n<9?b:s; char c=q[n].charAt(0); char e=q[n].charAt(1); char[] h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c}; q[n]=new String(h); for (int i=0;i<22;i++){if (n<14&&i-n<4&&i>n) q[i]=q[i]!=null?q[i].substring(0,3)+"|"+q[i].charAt(4):s; else if (n>13&&n-i<4&&n>i) q[i]=q[i]!=null?q[i].substring(0,3)+"|"+q[i].charAt(4):s;} for (int i=21;i>=0;i--) if (!(i>n&&i>18||i<n&&i<10)) System.out.println((q[i]==null)?s:q[i]);}}

Oh please don't hate me, it's my first time. I coulnd't find any faq/introduction so I hope my posting format is ok. Not sure how serious people got about character counts.... normal version of the code - extra is linebreak/spaces (1313 characters):

public class DisplayNote
{
  public static void main(String[] args)
  {
    char[] z=args[0].toCharArray();
    char[] y=new char[3];
    y[0]=('H'==z[0]||'L'==z[0])?z[0]:'N';
    int o=(y[0]=='N')?0:1;
    y[1]=z[o++];
    y[2]=z.length>o?z[o]:'!';

    int noteValue=y[1]<'C'?((int) (y[1] - 'A')) + 6:((int) (y[1] - 'C')) + 1;
    noteValue=(y[0]=='N')?noteValue+7:(y[0]=='H'?noteValue+14:noteValue);
    String s="     ";
    String b=" --- ";
    String[] out=new String[22];
    for (int i=1;i<=21;i+=2){out[i]=s;}
    for (int i=10;i<=18;i+=2){out[i]="-----";}
    out[20]=noteValue>19?b:s;
    out[2]=noteValue<3?b:s;
    out[4]=noteValue<5?b:s;
    out[6]=noteValue<7?b:s;
    out[8]=noteValue<9?b:s;

    char c=out[noteValue].charAt(0);
    char e=out[noteValue].charAt(1);
    char[] h=new char[]{c,y[2]=='!'?e:y[2],'O',e,c};
    out[noteValue]=new String(h);
    for (int i=0;i<22;i++)
    {
      if (noteValue<14&&i-noteValue<4&&i>noteValue)
        out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;
      else if (noteValue>13&&noteValue-i<4&&noteValue>i)
        out[i]=out[i]!=null?out[i].substring(0,3)+"|"+out[i].charAt(4):s;        
    }

    for (int i=21;i>=0;i--)
      if (!(i>noteValue&&i>18||i<noteValue&&i<10))
        System.out.println((out[i]==null)?s:out[i]);
  }
}