Guitar Tabs Scoreboard
Rank Username Score
1 primo 1000 (69 B)
2 JWvdVeer 958 (72 B)
3 Wim 920 (75 B)
4 linepogl 885 (78 B)
5 scottholdren 566 (122 B)
6 jth 527 (131 B)
7 dddbmt 519 (133 B)
8 chrisjean 511 (135 B)
Recent Activity
Username Bytes Time ago Result
primo 69 January 18 2012, 01:17:19
evilchii 155 March 29 2011, 19:30:21
evilchii 142 March 29 2011, 19:23:09
evilchii 144 March 29 2011, 19:17:42
evilchii 181 March 29 2011, 18:20:32
evilchii 180 March 29 2011, 18:19:11
JWvdVeer 72 March 28 2011, 07:27:52
JWvdVeer 74 March 28 2011, 07:25:43
dddbmt 133 March 28 2011, 00:43:18
dddbmt 139 March 28 2011, 00:34:01
dddbmt 147 March 28 2011, 00:28:32
Wim 75 March 27 2011, 22:15:33
linepogl 78 March 26 2011, 11:27:39
linepogl 78 March 26 2011, 11:26:08
Wim 84 March 24 2011, 22:13:59

Challenge: Guitar Tabs

Challenge information

Challenge Type Public
Challenge Status Open
Constant name TAB
Trim method Full trim
Rating [ up ] [ down ]

Instructions

The constant will contain a guitar tab for a random chord.

Print out the ASCII chord chart for the tab.

The tabs:

    G chord

    Input       Output
    |--3--|     _____________________
    |--0--|     |___|___|___|___|___|
    |--0--|     |___X___|___|___|___|
    |--0--|     X___|___|___|___|___X
    |--2--|     |___|___|___|___|___|
    |--3--|     |___|___|___|___|___|


    C chord

    Input       Output
    |--0--|     _____________________
    |--1--|     |___|___|___|___X___|
    |--0--|     |___|___X___|___|___|
    |--2--|     |___X___|___|___|___|
    |--3--|     |___|___|___|___|___|
    |--X--|     |___|___|___|___|___|


    D chord

    Input       Output
    |--2--|     _____________________
    |--3--|     |___|___|___|___|___|
    |--2--|     |___|___|___X___|___X
    |--0--|     |___|___|___|___X___|
    |--X--|     |___|___|___|___|___|
    |--X--|     |___|___|___|___|___|


    E chord

    Input       Output
    |--0--|     _____________________
    |--0--|     |___|___|___X___|___|
    |--1--|     |___X___X___|___|___|
    |--2--|     |___|___|___|___|___|
    |--2--|     |___|___|___|___|___|
    |--0--|     |___|___|___|___|___|


    EM chord

    Input       Output
    |--0--|     _____________________
    |--0--|     |___|___|___|___|___|
    |--0--|     |___X___X___|___|___|
    |--2--|     |___|___|___|___|___|
    |--2--|     |___|___|___|___|___|
    |--0--|     |___|___|___|___|___|


    A chord

    Input       Output
    |--0--|     _____________________
    |--2--|     |___|___|___|___|___|
    |--2--|     |___|___X___X___X___|
    |--2--|     |___|___|___|___|___|
    |--0--|     |___|___|___|___|___|
    |--X--|     |___|___|___|___|___|


    AM chord

    Input       Output
    |--0--|     _____________________
    |--1--|     |___|___|___|___X___|
    |--2--|     |___|___X___X___|___|
    |--2--|     |___|___|___|___|___|
    |--0--|     |___|___|___|___|___|
    |--X--|     |___|___|___|___|___|


    F chord

    Input       Output
    |--1--|     _____________________
    |--1--|     |___|___|___|___X___X
    |--2--|     |___|___|___X___|___|
    |--3--|     |___|___X___|___|___|
    |--X--|     |___|___|___|___|___|
    |--X--|     |___|___|___|___|___|


    FM chord

    Input       Output
    |--1--|     _____________________
    |--1--|     X___|___|___X___X___X
    |--1--|     |___|___|___|___|___|
    |--3--|     |___X___X___|___|___|
    |--3--|     |___|___|___|___|___|
    |--1--|     |___|___|___|___|___|

Example

Show/hide Input
|--0--|
|--1--|
|--0--|
|--2--|
|--3--|
|--X--|
Show/hide Output
_____________________
|___|___|___|___X___|
|___|___X___|___|___|
|___X___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|

Comments

Show/hide comments (0)

Submissions

69 bytes (ver. 1) by primo Show / Hide
<?for($a=TAB;$i<36;)echo$i>5?$i/6^$a[43-$i%6*8]?~:X:_,++$i%6?___:~;
72 bytes (ver. 15) by JWvdVeer Show / Hide
<?for(;$i<36;$a=TAB)echo$i>5?$i/6^$a[8*(6-$i%6)-5]?~:X:_,++$i%6?___:~;
74 bytes (ver. 14) by JWvdVeer Show / Hide
<?for(;$i<36;$a=TAB)echo$i<6?_:~($i/6^$a[8*(6-$i%6)-5]?:),++$i%6?___:~;
75 bytes (ver. 9) by Wim Show / Hide
<?for($t=TAB;$j--||$i<=$j=5;$j?:$i++)echo$i?$i^$t[3+8*$j]?~:X:_,$j?___:~;
78 bytes (ver. 10) by linepogl Show / Hide
<?for($z=TAB;$i<6;$i++)for($j=6;$j--;)echo$i?($i-$z[3+8*$j]?~:X):_,$j?___:~;
84 bytes (ver. 8) by Wim Show / Hide
<?=str_repeat(_,21).~;for($t=TAB;$j||++$i<$j=6;)echo$i-$t[3+8*--$j]?~:X,$j?___:~;
86 bytes (ver. 7) by Wim Show / Hide
<?=str_repeat(_,21)?>

<?for($t=TAB;$j||++$i<$j=6;)echo$i-$t[3+8*--$j]?~:X,$j?___:~;
94 bytes (ver. 8) by linepogl Show / Hide
<?=str_repeat(_,21)?>

<?for($z=TAB;++$i<6;)for($j=6;$j;)echo$i-$z[3+8*--$j]?'|':X,$j?___:"
"
;
96 bytes (ver. 7) by linepogl Show / Hide
<?=str_repeat(_,21)?>

<?for($z=TAB;++$i<6;)for($j=6;0<$j;)echo$i-$z[3+8*--$j]?'|':X,$j?___:"
"
;
102 bytes (ver. 13) by JWvdVeer Show / Hide
<?$a=str_repeat;for($b=~$a(.$a(,5),5);6>$g;@$b[$c[3+8*$g++]*22+3-$g*4]=X)$c=TAB;echo$a(_,21),$b;
103 bytes (ver. 12) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=~$a(.$a(,5),5);for(;6>$g;@$b[$c[3+8*$g++]*22+3-$g*4]=X)$c=TAB;echo$a(_,21),$b;
106 bytes (ver. 10) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=~$a(.$a(,5),5);for($d=3;5>$g;@$b[$c[3+8*$g++]*22+$d-=4]=X)$c=TAB;echo$a(_,21),$b;
108 bytes (ver. 9) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=~$a(.$a(,5),5);for($d=3;-21<$d;@$b[$c[3+8*$g++]*22+$d-=4]=X)$c=TAB;echo$a(_,21),$b;
109 bytes (ver. 7) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=$a(.$a(,5),5);for($c=TAB,$d=51;0<$d-=8;)@$b[$g++*4+$c[$d]*22-21]=;echo$a(_,21).~$b;
109 bytes (ver. 8) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=~$a(.$a(,5),5);$c=TAB;for($d=3;-21<$d;)@$b[$c[3+8*$g++]*22+$d-=4]=X;echo$a(_,21),$b;
113 bytes (ver. 6) by Wim Show / Hide
<?$a=str_repeat;$s=$a(,21).$a(.$a(,5),5);for($d=~TAB;$p=$d[$i++*8+3];)!+~$p?:$s[24-$i*4+~$p*22]=;echo~$s;
114 bytes (ver. 4) by Wim Show / Hide
<?$a=str_repeat;$s=$a(,21).$a(.$a(,5).,5);for($d=~TAB;$p=$d[$i++*8+3];)!+~$p?:$s[24-$i*4+~$p*22]=;echo~$s;
115 bytes (ver. 3) by Wim Show / Hide
<?$a=str_repeat;$s=$a(,21).$a(.$a(,5).,5);for($d=~TAB;$p=$d[$i++*8+3];)!+~$p?:$s[24-$i*4+~$p*22]=~X;echo~$s;
117 bytes (ver. 6) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=$a(,21).$a(.$a(,5),5);for($c=TAB,$d=51;0<$d-=8;)(22>$f=$g++*4+$c[$d]*22)?:$b[$f]=;echo~$b;
119 bytes (ver. 5) by JWvdVeer Show / Hide
<?$a=str_repeat;$b=$a(,21).$a(.$a(,5),5);$c=TAB;for($d=24;0<$d;)(21>$f=$c[3+8*$g++]*22+$d-=4)?:$b[$f]=;echo~$b;
122 bytes (ver. 4) by scottholdren Show / Hide
<?echo str_repeat(_,21)."\n";for(preg_match_all("/\d/",TAB,$m);++$i<6;)for($j=6;$j--;)echo$m[0][$j]==$i?X:"|",$j?___:"\n";
126 bytes (ver. 3) by scottholdren Show / Hide
<?echo str_repeat(_,21)."\n";for(preg_match_all("/\d/",TAB,$m);++$i<6;)for($j=6;$j--;)echo($m[0][$j]==$i?X:"|").($j?___:"\n");
129 bytes (ver. 4) by JWvdVeer Show / Hide
<?$a=str_repeat;for($b=$a(,21);++$c<6;$e=TAB)$b.=.$a(,5);for($d=24;0<$d;)(21>$f=$e[3+8*$g++]*22+$d-=4)?:$b[$f]=~X;echo~$b;
131 bytes (ver. 2) by Wim Show / Hide
<?$l="
|___|___|___|___|___|"
;$s="_____________________$l$l$l$l$l";for($d=~TAB;$p=$d[$i++*8+3];)!+~$p?:$s[24-$i*4+~$p*22]=X;echo$s;
131 bytes (ver. 1) by jth Show / Hide
<?echo str_repeat(~,21).~;for($t=split(~,TAB);++$i<6;$a=null){for($j=0;$j<6;)$a[]=$t[5-$j++][3]-$i?~:~;echo join(~,$a).~;}
133 bytes (ver. 3) by dddbmt Show / Hide
_____________________
<?$t=split("\n",TAB);for($i=1;$i<6;$i++,$u=''){for($j=6;$j;$j--,$u=___)echo$u.($t[$j-1][3]==$i?X:"|");echo"
"
;}
135 bytes (ver. 3) by chrisjean Show / Hide
_____________________
<?$m=preg_split('/\W+/',TAB);while(++$x<6){$y=0;while($y++<6){echo($m[7-$y]==$x)?X:'|';if($y<6)echo'___';}?>

<?}
137 bytes (ver. 3) by JWvdVeer Show / Hide
<?$a=str_repeat;for($b=$a(~_,21);++$c<6;$e=TAB)$b.=~"\n|".$a(~"___|",5);for($d=24;0<$d;)(21>$f=$e[3+8*$g++]*22+$d-=4)?:$b[$f]=~X;echo~$b;
137 bytes (ver. 2) by chrisjean Show / Hide
_____________________
<?$m=preg_split('/[\W]+/',TAB);while(++$x<6){$y=0;while($y++<6){echo($m[7-$y]==$x)?X:'|';if($y<6)echo'___';}?>

<?}
139 bytes (ver. 2) by scottholdren Show / Hide
<?preg_match_all("(\d)",TAB,$m);echo str_repeat(_,21)."\n";for(;++$i<6;){for($j=6;$j--;)$r[$j]=$m[0][$j]==$i?X:"|";echo join(___,$r)."\n";}
139 bytes (ver. 2) by dddbmt Show / Hide
_____________________
<?$t=split("\n",TAB);for($i=1;$i<6;$i++,$u=''){for($j=5;$j>=0;$j--,$u='___')echo$t[$j][3]==$i?$u."X":$u."|";echo"
"
;}
148 bytes (ver. 1) by chrisjean Show / Hide
_____________________
<?preg_match_all('/-(.)-/',TAB,$m);while(++$x<6){$y=0;while($y++<6){echo($m[1][6-$y]==$x)?X:'|';echo($y<6)?'___':'';}echo"
"
;}
348 bytes (ver. 1) by scottholdren Show / Hide
<?

define
(TAB,"|--0--|
|--1--|
|--0--|
|--2--|
|--3--|
|--X--|"
);
preg_match_all("(\d)",TAB,$m);
#print_r($m);
#exit;

echo str_repeat("_",21)."\n";
for(;++
$i<6;)
{
    for(
$j=6;$j--;)
    {
#        print "$j\n";
        
$r[$j]=($m[0][$j]==$i)>0?"X":"|";
    }
#    $r=array_fill(0,6,'|');
#    foreach($r
#    $r[$m[0][$i]-1] = "X";
    
print join("___",$r) . "\n";
}
#echo TAB;