-2
\$\begingroup\$

Your goal is to draw the Linkin Park Logo in minimum bytes.

The Linkin Park logo

Please add a title with the language and the number of bytes in your code.

\$\endgroup\$
17
  • 2
    \$\begingroup\$ it's the circle around the logo required? \$\endgroup\$
    – Fez Vrasta
    Feb 7, 2014 at 14:15
  • 1
    \$\begingroup\$ So what are the winning criteria? Is this code golf? \$\endgroup\$
    – Josh
    Feb 7, 2014 at 14:23
  • 5
    \$\begingroup\$ As per the site, all problems must have An objective primary winning criterion. How how you measuring entries against each other? \$\endgroup\$
    – Josh
    Feb 7, 2014 at 14:29
  • 1
    \$\begingroup\$ @Josh I wrote much lines.. and i cant ask you all to write less bytes but if you want you can consider it as CodeGolf so shall I. \$\endgroup\$ Feb 7, 2014 at 14:31
  • 1
    \$\begingroup\$ The question and the goal is all set now! \$\endgroup\$ Feb 7, 2014 at 14:42

4 Answers 4

1
\$\begingroup\$

PHP

<?=l(11,0).l(3,1)."\n".l(10,0).l(3,1)."\n".l(9,0).l(3,1).l(9,0).l(3,1)."\n".l(8,0).l(3,1).l(9,0).l(5,1)."\n".l(7,0).l(3,1).l(9,0).l(3,1).l(1,0).l(3,1)."\n".l(6,0).l(3,1).l(9,0).l(3,1).l(3,0).l(3,1)."\n".l(5,0).l(3,1).l(9,0).l(3,1).l(5,0).l(3,1)."\n".l(4,0).l(3,1).l(9,0).l(3,1).l(7,0).l(3,1)."\n".l(3,0).l(27,1)."\n".l(14,0).l(3,1)."\n".l(13,0).l(3,1)."\n".l(12,0).l(3,1)."\n".l(11,0).l(3,1)."\n";function l($a,$c,$o=''){if($c){$c='=';}else{$c=' ';};for($i=0;$i<$a;$i++){$o.=$c;}return $o;}

Ok actually it's longer than write an echo with the logo but It's the first thing which has hit my mind.

\$\endgroup\$
1
\$\begingroup\$

Python, 169 bytes

e=' '
z=6*e
x='==='
f=z+x
for i in[e*10+x,e*9+x,e*8+x,e*7+x+f,e*6+x+f+'==',e*5+x+f+e+x,e*4+x+f+e*3+x,e*3+x+f+e*5+x,
e*2+x+f+e*7+x,e+x*8,x*8,e*8+x,e*7+x,e*6+x]:
    print i

I'm sure it can (and will be) done in shorter code. Output:

          ===
         ===
        ===
       ===      ===
      ===      =====
     ===      === ===
    ===      ===   ===
   ===      ===     ===
  ===      ===       ===
 ========================
========================
        ===
       ===
      ===
[Finished in 0.1s]

Try it for yourself, python 2.7.

\$\endgroup\$
3
  • \$\begingroup\$ Well, I submitted code whle the circle was not required. It's invalid now, I presume? :) \$\endgroup\$
    – Taku
    Feb 7, 2014 at 17:49
  • \$\begingroup\$ that circle is still not required \$\endgroup\$ Feb 7, 2014 at 18:16
  • \$\begingroup\$ ah, good. As this way would lead me nowhere with whe circle, however, I'll try to come up with something that does it. Although I doubt I can manage it with Python :) \$\endgroup\$
    – Taku
    Feb 7, 2014 at 19:55
1
\$\begingroup\$

Using C++ (Answering my own question) ;)

#include<iostream.h>
#include<conio.h>

void linkinparklogo(int posx, int posy) //Linkin Park Logo Starts
{
     highvideo();
     for(int slant=0; slant<=10; slant++) //Slant Part of "L"
     {
     for(int l=1; l<=3; l++)
         {gotoxy(posx+10-slant+l,posy+1+slant); cprintf("=");}
     }
     getch();
     for(int straight=0; straight<=20; straight++) //Lower Part of Horizontal"L"
     {   gotoxy(posx+4+straight,posy+11); cprintf("=");
     }
     getch();
     for(straight=0; straight<=22; straight++) //Upper Part of Horizontal "L"
     {   gotoxy(posx+3+straight,posy+10); cprintf("=");
     }
     getch();
     for(slant=0; slant<=5; slant++) //Right Slant Part of "P"
     {
         for(int p=1; p<=3; p++)
         {gotoxy(posx+21-slant+p,posy+9-slant); cprintf("=");}
     }
     getch();
     gotoxy(posx+17,posy+5); cprintf("=");
     gotoxy(posx+16,posy+5); cprintf("=");
     getch();
     for(slant=0; slant<=9; slant++) //Left Slant Part of "P"
     {
         for(int ps=1; ps<=3; ps++)
         {gotoxy(posx+14-slant+ps,posy+6+slant); cprintf("=");}
     }
} //Linkin Park Logo Created
void main()
{
     clrscr();
     linkinparklogo(0,0);
     getch();
}

Output:

LP

\$\endgroup\$
0
\$\begingroup\$

Delphi

User gives 2 characters which will be used as foreground and background, spaces will work too.

uses idglobal;//Required for IIF function
var
i:int8;
s:string;
fg,bg:char; //Foreground + Background
function soc(c:char;Cnt:integer=3):string;
begin
  Result:=StringOfChar(c, cnt)
end;
begin
writeln('Give foreground and background characters');
Readln(fg,bg);
  for I:=0to 16do
  begin
    s:='';
    if i in[0,16]then
    begin
      s:=soc(bg,29);
      WriteLn(s);
      continue
    end;
    if i in[1,2,3,4,5,6,7,8,9,10,11]then
      s:=soc(bg,17-i-3)+iif(i in[10,11],soc(fg,24),soc(fg))
    else if i in[12,13,14,15]then
      s:=soc(bg,(17-i-3)+8)+soc(fg);
    if i in[4,5,6,7,8,9]then
      s:=s+soc(bg,6);
    case i of
      4:s:=s+soc(fg);
      5:s:=s+soc(fg,5);
      6:s:=s+soc(fg)+bg+soc(fg);
      7:s:=s+soc(fg)+soc(bg)+soc(fg);
      8:s:=s+soc(fg)+soc(bg,5)+soc(fg);
      9:s:=s+soc(fg)+soc(bg,7)+soc(fg);
    end;
    s:=s+soc(bg,29-length(s));
    WriteLn(s);
  end;
  readln;
end.

Results

I must add to this that it looks much better in console lol.

Input: $/                       Input: (space)=  
Output:                         Output:
/////////////////////////////   =============================
/////////////$$$/////////////   =============   =============
////////////$$$//////////////   ============   ==============
///////////$$$///////////////   ===========   ===============
//////////$$$//////$$$///////   ==========   ======   =======
/////////$$$//////$$$$$//////   =========   ======     ======
////////$$$//////$$$/$$$/////   ========   ======   =   =====
///////$$$//////$$$///$$$////   =======   ======   ===   ====
//////$$$//////$$$/////$$$///   ======   ======   =====   ===
/////$$$//////$$$///////$$$//   =====   ======   =======   ==
////$$$$$$$$$$$$$$$$$$$$$$$$/   ====                        =
///$$$$$$$$$$$$$$$$$$$$$$$$//   ===                        ==
//////////$$$////////////////   ==========   ================
/////////$$$/////////////////   =========   =================
////////$$$//////////////////   ========   ==================
///////$$$///////////////////   =======   ===================
/////////////////////////////   =============================

Dont look to long to the first image.

Feels weird :P

Images:

V1V2

V3

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.