Skip to main content
down to 44+2=46, thanks to @Neil
Source Link
steve
  • 2.4k
  • 2
  • 16
  • 25

Perl, 90 50, 50 + 2 (-p flag) = 52 bytes 44 + 2 (-p flag) = 5246 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26; $x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26
$x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26'x26;$_="^[[44m$x^[[47m$x^[[41m$x^[[0m\n"x26

Hexdump:

$ xxd flag.pl
00000000: 2478 3d27 2027 2078 20327832 373b363b 245f 3d22  $x='1b5b ' x$x=' 27;$_="'x26;$_=".[
00000010: 1b5b 3434 6d24 781b 5b34 376d 2478 1b5b 3431 .[44m$x 44m$x.[47m$x.[[41
00000020: 3431 6d24 781b 5b34 306d 5c6e 2220 7820  41m$x.[40m\n" x
00000030: 3236 0a                     5b30 6d5c 6e22 7832 360a       26m$x.
$[0m\n"x26.

enter image description here

Perl, 90 50 + 2 (-p flag) = 52 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;
$x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26

Hexdump:

$ xxd flag.pl
00000000: 2478 3d27 2027 2078 2032 373b 245f 3d22  $x=' ' x 27;$_="
00000010: 1b5b 3434 6d24 781b 5b34 376d 2478 1b5b  .[44m$x.[47m$x.[
00000020: 3431 6d24 781b 5b34 306d 5c6e 2220 7820  41m$x.[40m\n" x
00000030: 3236 0a                                26.
$

enter image description here

Perl, 90, 50 + 2 (-p flag) = 52 bytes 44 + 2 (-p flag) = 46 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26; $x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26
$x=' 'x26;$_="^[[44m$x^[[47m$x^[[41m$x^[[0m\n"x26

Hexdump:

00000000: 2478 3d27 2027 7832 363b 245f 3d22 1b5b  $x=' 'x26;$_=".[
00000010: 3434 6d24 781b 5b34 376d 2478 1b5b 3431  44m$x.[47m$x.[41
00000020: 6d24 781b 5b30 6d5c 6e22 7832 360a       m$x.[0m\n"x26.

enter image description here

embed escape codes in script, lose sprintf
Source Link
steve
  • 2.4k
  • 2
  • 16
  • 25

Perl, 9090 50 + 2 (-p flag) = 52 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;
$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,'$x=' ',27,' ',27;printx $_27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26;26

Run it online hereHexdump:

$ xxd flag.pl
00000000: 2478 3d27 2027 2078 2032 373b 245f 3d22  $x=' ' x 27;$_="
00000010: 1b5b 3434 6d24 781b 5b34 376d 2478 1b5b  .[44m$x.[47m$x.[
00000020: 3431 6d24 781b 5b34 306d 5c6e 2220 7820  41m$x.[40m\n" x
00000030: 3236 0a                                26.
$

enter image description hereenter image description here

Perl, 90 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;

Run it online here

enter image description here

Perl, 90 50 + 2 (-p flag) = 52 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;
$x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26

Hexdump:

$ xxd flag.pl
00000000: 2478 3d27 2027 2078 2032 373b 245f 3d22  $x=' ' x 27;$_="
00000010: 1b5b 3434 6d24 781b 5b34 376d 2478 1b5b  .[44m$x.[47m$x.[
00000020: 3431 6d24 781b 5b34 306d 5c6e 2220 7820  41m$x.[40m\n" x
00000030: 3236 0a                                26.
$

enter image description here

added img
Source Link
steve
  • 2.4k
  • 2
  • 16
  • 25

Perl, 9190 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m \n""%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;

Run it online here.here

enter image description here

Perl, 91 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m \n",27,' ',27,' ',27,' ',27;print $_ x 26;

Run it online here.

Perl, 90 bytes

As nobody's done a Perl version yet, here we go:

$_=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $_ x 26;

Run it online here

enter image description here

Source Link
steve
  • 2.4k
  • 2
  • 16
  • 25
Loading