45
\$\begingroup\$

Your task is to print the hexidecimal times table:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 
00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 
00 03 06 09 0c 0f 12 15 18 1b 1e 21 24 27 2a 2d 
00 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 
00 05 0a 0f 14 19 1e 23 28 2d 32 37 3c 41 46 4b 
00 06 0c 12 18 1e 24 2a 30 36 3c 42 48 4e 54 5a 
00 07 0e 15 1c 23 2a 31 38 3f 46 4d 54 5b 62 69 
00 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78 
00 09 12 1b 24 2d 36 3f 48 51 5a 63 6c 75 7e 87 
00 0a 14 1e 28 32 3c 46 50 5a 64 6e 78 82 8c 96 
00 0b 16 21 2c 37 42 4d 58 63 6e 79 84 8f 9a a5 
00 0c 18 24 30 3c 48 54 60 6c 78 84 90 9c a8 b4 
00 0d 1a 27 34 41 4e 5b 68 75 82 8f 9c a9 b6 c3 
00 0e 1c 2a 38 46 54 62 70 7e 8c 9a a8 b6 c4 d2 
00 0f 1e 2d 3c 4b 5a 69 78 87 96 a5 b4 c3 d2 e1 

Specifications:

  • You can print the hex values in uppercase.
  • Your lines can end with a trailing space and the program output can end with a trailing newline.
  • Every hex value must be padded to 2 digits with 0s as shown.

This is , so the shortest answer (measured in bytes) wins.

\$\endgroup\$
  • \$\begingroup\$ Related \$\endgroup\$ – Luis Mendo Dec 17 '16 at 1:18
  • \$\begingroup\$ Also related \$\endgroup\$ – Digital Trauma Dec 17 '16 at 1:45
  • 4
    \$\begingroup\$ Multiplication tables don't usually include factor 0... :-) \$\endgroup\$ – Luis Mendo Dec 17 '16 at 1:55
  • 28
    \$\begingroup\$ @Luis Mendo: How else will school children be able to memorize what 0 times a number is? :P \$\endgroup\$ – milk Dec 17 '16 at 1:56
  • 1
    \$\begingroup\$ Darn, I wanted to make a solution using hexdump, but that groups into 4-byte blocks. :( \$\endgroup\$ – HyperNeutrino Feb 26 '17 at 1:04

58 Answers 58

2
\$\begingroup\$

Stax, 11 bytes

äΔ←ùûv╚ö♦.J

Run and debug it

\$\endgroup\$
14
\$\begingroup\$

Python 2, 60 bytes

for n in range(256):r=n%16;print'%02x%s'%(n/16*r,r/15*'\n'),

Try it online!

How it works

For all integers n from 0 to 255, we do the following.

  • We compute (n / 16) × (n % 16).

    Over the range of n, both n / 16 and n % 16 independently cover the range 0, …, 15, so this generates all entries of the multiplication table.

  • We repeat the linefeed character ('\n') (n % 16) / 15 times, which results in the same character when n % 16 = 15 and an empty string otherwise.

  • The format string '%02x%s' turns the two previous results into a single string, first a lowercase hexadecimal integer representation, zero-padded to (at least) two digits, then the generated string.

  • Finally, print..., prints the formatted results.

    Since the print statement ends with a comma, Python will not append a linefeed. Also, before printing the next string, Python will prepend a space unless we're at the beginning of a new line. (source) This happens to format the output exactly like we want to.

\$\endgroup\$
14
\$\begingroup\$

Jelly, 12 bytes

⁴Ḷ×þ`d⁴‘ịØhG

Try it online!

How it works

⁴Ḷ×þ`d⁴‘ịØhG  Main link. No arguments.

⁴             Set the return value to 16.
 Ḷ            Unlength; yield [0, ..., 15].
  ×þ`         Build the multiplication table of [0, ..., 15] and itself.
     d⁴       Divmod 16; yield [p : 16, p % 16] for each product p.
       ‘      Increment quotients and remainders (1-based indexing).
        ịØh   Index into the lowercase hexadecimal alphabet.
           G  Grid; join columns by spaces, rows by newlines.
\$\endgroup\$
  • \$\begingroup\$ That's 12 characters, not bytes. According to the question, answer is measured in bytes, and your answer is 25 bytes and 12 characters. At least according to this website mothereff.in/byte-counter \$\endgroup\$ – Ciprum Dec 18 '16 at 20:45
  • 18
    \$\begingroup\$ In UTF-8, sure. However, Jelly uses a SBCS, so each character can be encoded using a single byte. \$\endgroup\$ – Dennis Dec 18 '16 at 20:59
11
\$\begingroup\$

R, 42 bytes

as.hexmode(sapply(0:15,function(x)x*0:15))

Prints the following:

      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16]
 [1,] "00" "00" "00" "00" "00" "00" "00" "00" "00" "00"  "00"  "00"  "00"  "00"  "00"  "00" 
 [2,] "00" "01" "02" "03" "04" "05" "06" "07" "08" "09"  "0a"  "0b"  "0c"  "0d"  "0e"  "0f" 
 [3,] "00" "02" "04" "06" "08" "0a" "0c" "0e" "10" "12"  "14"  "16"  "18"  "1a"  "1c"  "1e" 
 [4,] "00" "03" "06" "09" "0c" "0f" "12" "15" "18" "1b"  "1e"  "21"  "24"  "27"  "2a"  "2d" 
 [5,] "00" "04" "08" "0c" "10" "14" "18" "1c" "20" "24"  "28"  "2c"  "30"  "34"  "38"  "3c" 
 [6,] "00" "05" "0a" "0f" "14" "19" "1e" "23" "28" "2d"  "32"  "37"  "3c"  "41"  "46"  "4b" 
 [7,] "00" "06" "0c" "12" "18" "1e" "24" "2a" "30" "36"  "3c"  "42"  "48"  "4e"  "54"  "5a" 
 [8,] "00" "07" "0e" "15" "1c" "23" "2a" "31" "38" "3f"  "46"  "4d"  "54"  "5b"  "62"  "69" 
 [9,] "00" "08" "10" "18" "20" "28" "30" "38" "40" "48"  "50"  "58"  "60"  "68"  "70"  "78" 
[10,] "00" "09" "12" "1b" "24" "2d" "36" "3f" "48" "51"  "5a"  "63"  "6c"  "75"  "7e"  "87" 
[11,] "00" "0a" "14" "1e" "28" "32" "3c" "46" "50" "5a"  "64"  "6e"  "78"  "82"  "8c"  "96" 
[12,] "00" "0b" "16" "21" "2c" "37" "42" "4d" "58" "63"  "6e"  "79"  "84"  "8f"  "9a"  "a5" 
[13,] "00" "0c" "18" "24" "30" "3c" "48" "54" "60" "6c"  "78"  "84"  "90"  "9c"  "a8"  "b4" 
[14,] "00" "0d" "1a" "27" "34" "41" "4e" "5b" "68" "75"  "82"  "8f"  "9c"  "a9"  "b6"  "c3" 
[15,] "00" "0e" "1c" "2a" "38" "46" "54" "62" "70" "7e"  "8c"  "9a"  "a8"  "b6"  "c4"  "d2" 
[16,] "00" "0f" "1e" "2d" "3c" "4b" "5a" "69" "78" "87"  "96"  "a5"  "b4"  "c3"  "d2"  "e1" 
\$\endgroup\$
  • 1
    \$\begingroup\$ How about: as.hexmode(outer(0:15,0:15,`*`)) \$\endgroup\$ – ixodesbeta Feb 25 '17 at 0:41
  • 2
    \$\begingroup\$ Or better yet, as.hexmode(0:15%o%0:15) \$\endgroup\$ – Giuseppe Sep 5 '17 at 14:13
10
\$\begingroup\$

Bash + coreutils, 40

  • 1 byte saved thanks to @MitchellSpector
printf %02x\  $[{0..15}*{0..15}]|fmt -52
  • Bash expands brace expansions before arithmetic expansions, so the string $[{0..15}*{0..15}] first expands to $[0*0] $[0*1] $[0*2] ... $[0*15] $[1*0] ... $[15*15].
  • The above series of arithmetic expansions then expand to the numerical table contents, as decimal integers.
  • The printf '%02x ' expresses this list of decimal integers as hex, zero-padded to two characters
  • fmt -52 formats the integers as 47 character wide lines, giving the desired alignment. Note fmt tries to make lines goal characters wide. By default, this is 7% shorter than width. 52*93% -1 (for newline) = 47.

Try it online.

\$\endgroup\$
  • 1
    \$\begingroup\$ Nice solution. It looks like you can shave one byte off by using fmt -52 (without the w). \$\endgroup\$ – Mitchell Spector Dec 18 '16 at 9:55
  • \$\begingroup\$ nice! btw. in zsh it could be {0..15}\*{0..15} which is 2 bytes shorter :) \$\endgroup\$ – ბიმო Mar 16 at 19:58
5
\$\begingroup\$

C#6, 98 bytes

()=>{int i,j;for(i=-1;++i<16;)for(j=-1;++j<16;)System.Console.Write($"{i*j:x2} {j<15?"":"\n"}");};

repl.it demo

Standard nested for-loop. Only trick is to print newline when j>=15.

\$\endgroup\$
  • \$\begingroup\$ +1, but it seems repl.it doesn't like $"" \$\endgroup\$ – Metoniem Feb 22 '17 at 10:25
  • \$\begingroup\$ @Metoniem tio.run/# is much superior \$\endgroup\$ – HyperNeutrino Mar 16 at 21:48
4
\$\begingroup\$

JavaScript (ES6), 79 78 77 bytes

f=(i=256)=>i?f(--i)+(i%16*(i>>4)+256).toString(16).slice(1)+`
 `[~i&15&&1]:``

document.write('<pre>'+f())

Edit: Saved 1 byte thanks to @ETHproductions and another byte thanks to @YairRand.

\$\endgroup\$
  • \$\begingroup\$ @ETHproductions Bah, the .slice(-2) was left over from when I was doing ('0'+toString(16)). I think I'd already tried ' \n'[+!(~i&15)] but it's the same length. \$\endgroup\$ – Neil Dec 17 '16 at 22:01
  • \$\begingroup\$ @ETHproductions I also saved 1 bytes... \$\endgroup\$ – Neil Dec 17 '16 at 22:14
  • \$\begingroup\$ You can save a byte by replacing (~i&15?' ':'\n') with ' \n'[~i&15&&1] . \$\endgroup\$ – Yair Rand Feb 7 at 4:57
  • \$\begingroup\$ @YairRand I think you mean '\n ' but I get the idea, thanks! \$\endgroup\$ – Neil Feb 7 at 10:21
3
\$\begingroup\$

MATL, 19 18 bytes

16:q&*1YAO3Z(!48e!

Try it online!

16:q   % Push [0 1 ... 15]
&*     % 16×16 matrix of pairwise products
1YA    % Convert to hexadecimal. Gives a 256×2 char array 
O3Z(   % Assign char 0 to 3rd column. Gives a 256×3 char array
!48e!  % Reshape in row-major order as a 48-column char array
       % Implicitly display. Char 0 is shown as space
\$\endgroup\$
3
\$\begingroup\$

Haskell, 87 bytes

import Numeric
main=mapM(\x->putStrLn$do y<-s;['0'|x*y<16]++showHex(x*y)" ")s
s=[0..15]

Try it online!

I imagine there's a better way. Maybe depend on the printf package....

\$\endgroup\$
3
\$\begingroup\$

K7, 36 bytes

` 0:" "/:'{`hex@`c$x}''{x*/:\:x}@!16
\$\endgroup\$
  • \$\begingroup\$ " "/:'(`hex@`c$)''x*/:x:!16 should do it \$\endgroup\$ – Alexander Belopolsky Apr 14 at 22:39
  • \$\begingroup\$ Better yet: (" "/:`hex@')'x*/:x:`c$!16 (26 bytes) \$\endgroup\$ – Alexander Belopolsky Apr 14 at 22:47
2
\$\begingroup\$

Ruby, 49 bytes

256.times{|i|print"%02x "%(i/16*j=i%16),$/*j/=15}

Pretty straightforward use of the % operator equivalent to sprintf.

$/ is the line separator variable (\n by default.)

Note the use of assignments such as j/=15 to avoid longer parentheses (j/15)

\$\endgroup\$
2
\$\begingroup\$

Mathematica, 46 bytes

Grid@Array[IntegerString[1##,16,2]&,{16,16},0]

Straightforward implementation using the built-in IntegerString, in base 16, padding to length 2. The Array[...,{16,16},0] has the two variables each run from 0 to 15.

\$\endgroup\$
2
\$\begingroup\$

PowerShell, 46 bytes

0..15|%{$i=$_;"$(0..15|%{"{0:X2}"-f($i*$_)})"}

Try it online!

Loops from 0 to 15, sets $i to be that current number, then loops again. Uses the -format operator with the X2 designation to specify the output is heXadecimal padded to 2 spaces with leading zeros.

Of special note, and really the only golf, is that instead of using a (...)-join' ' to take the hex results, encapsulate them in an array, and concatenate them together into a string, we leverage the fact that the default $OutputFieldSeparator value for stringifying an array is a space. That means we can do a string with a script block in it "$(...)" instead, saving 6 bytes.

Those strings are all left on the pipeline, and output via implicit Write-Output at program completion gives us a newline between them for free.

\$\endgroup\$
2
\$\begingroup\$

Matlab, 53 Bytes

for i=[0:15]'*[0:15];fprintf('%02X ',i);disp(' ');end

Sample output:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  
00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E  
00 03 06 09 0C 0F 12 15 18 1B 1E 21 24 27 2A 2D  
00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C  
00 05 0A 0F 14 19 1E 23 28 2D 32 37 3C 41 46 4B  
00 06 0C 12 18 1E 24 2A 30 36 3C 42 48 4E 54 5A  
00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69  
00 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78  
00 09 12 1B 24 2D 36 3F 48 51 5A 63 6C 75 7E 87  
00 0A 14 1E 28 32 3C 46 50 5A 64 6E 78 82 8C 96  
00 0B 16 21 2C 37 42 4D 58 63 6E 79 84 8F 9A A5  
00 0C 18 24 30 3C 48 54 60 6C 78 84 90 9C A8 B4  
00 0D 1A 27 34 41 4E 5B 68 75 82 8F 9C A9 B6 C3  
00 0E 1C 2A 38 46 54 62 70 7E 8C 9A A8 B6 C4 D2  
00 0F 1E 2D 3C 4B 5A 69 78 87 96 A5 B4 C3 D2 E1 
\$\endgroup\$
2
\$\begingroup\$

Perl, 48 bytes

for$a(@%=0..15){printf"%02x "x@%.$/,map$a*$_,@%}

Try it online!

I'm positive this isn't optimally golfed, but I'll be damned if I can find something better.

Code breakdown:

for$a(@%=0..15){printf"%02x "x@%.$/,map$a*$_,@%}
         0..15                                    #Create a list of the range 0 - 15...
      @%=                                         #...and store it in the array @%
for$a(        ){                               }  #Loop through @% with $a as the iterator
                printf[  string   ],[ params  ]   #Perl's port of the standard printf function
                      "%02x "                     #2-digit (hexit?) padding, followed by space...
                             x@%                  #...repeated 16 times (in scalar context, @% represents the size of array @%)...
                                .$/               #...followed by a newline
                                     map$a*$_,@%  #Loops through @%, and using $_ as the iterator, returns a list composed of each member of @% multiplied by the current $a
\$\endgroup\$
2
\$\begingroup\$

Perl 6, 42 bytes

.fmt("%02x").put for (^16 X*^16).rotor: 16

Try it

Expanded:

.fmt("%02x") # format each element of list to lowercase hex
.put         # print with trailing newline

for          # for each of the following

(
  ^16  # Range upto ( and excluding ) 16
  X*   # cross multiplied with
  ^16
).rotor: 16 # break it up into chunks of 16 values
\$\endgroup\$
2
\$\begingroup\$

JavaScript, 104 Bytes

s="";for(a=0;16>a;a++){for(b=0;16>b;b++)c=(a*b).toString(16),s=1==c.length?s+(" 0"+c):s+(" "+c);s+="\n"}

Call using variable s:

console.log("HEX Table: " + s)

Ungolfed code:

s=""; // Define s as empty string
for(a=0;16>a;a++){ // For y axis
  for(b=0;16>b;b++) // For x axis
    c=(a*b).toString(16),s=1==c.length?s+(" 0"+c):s+(" "+c); // Multiply and format
  s+="\n" // Add line breaks
}
\$\endgroup\$
  • \$\begingroup\$ Isn't "\n" line break? Wow, someone used pure ECMA for once. \$\endgroup\$ – Zacharý Dec 28 '16 at 22:47
  • \$\begingroup\$ And you should be able to use s+=2>c.length?" 0"+c:" "+c. \$\endgroup\$ – Zacharý Dec 28 '16 at 22:49
  • \$\begingroup\$ I know this is old, but I noticed a few savings that might help in future challenges too! you can set both a and s to "" since ""*0 is still 0. It's possible to inline your b++ to where it's being used in a*b too for a another slight saving, but if you rewrite the string append to: s+=" "+(0+(a*b++).toString(16)).substr(-2) that'll save a chunk. Should be at 86 bytes with those! Hope that helps! \$\endgroup\$ – Dom Hastings Aug 22 '17 at 7:39
2
\$\begingroup\$

C, 68 66 bytes

f(i){for(i=0;i<256;)printf("%02x%c",i%16*(i++/16),i%16<15?32:10);}

-2 bytes thanks to ceilingcat!

Ungolfed:

f(i){
  for(i=0; i<256;)
    printf("%02x%c", i%16*(i++/16), i%16<15 ? 32 : 10);
}

Prints the zero padded result and either space or newline.

\$\endgroup\$
  • \$\begingroup\$ Is that i implicitly deduced as int a standard feature of C? \$\endgroup\$ – sergiol Jan 4 '17 at 2:18
  • \$\begingroup\$ @sergiol yes, int is the default assumption. \$\endgroup\$ – Karl Napf Jan 4 '17 at 7:51
  • \$\begingroup\$ Sadly the output is undefined according to C standard (C99 - 6.5.2.2 Function calls). \$\endgroup\$ – Jasmes Aug 22 '17 at 11:58
  • \$\begingroup\$ Suggest ~i%16 instead of i%16<15 \$\endgroup\$ – ceilingcat Feb 7 at 19:24
2
\$\begingroup\$

Python 3, 55 bytes

r=range(16)
for x in r:print(*['%02x'%(x*y)for y in r])

Using %formatting saves quite a few bytes over [2:] usage. So does using * splats on the print function.

\$\endgroup\$
2
\$\begingroup\$

Japt -R, 20 15 bytes

GÆGÇ*X sGÃùT2 ¸

Try It Online!

GÆGÇ*X sGÃùT2 ¸
G                   :16
 Æ                  :Map each X in the range [0,G)
  GÇ                :  Map the range [0,G)
    *X              :    Multiply by X
       sG           :    Convert to base-16 string
         Ã          :  End map
          ù         :  Left pad each
           T        :    With 0
            2       :    To length 2
              ¸     :  Join with spaces
                    :Implicitly join with newlines and output
\$\endgroup\$
  • \$\begingroup\$ You just as easily could've done ® instead of Ë ;P \$\endgroup\$ – ETHproductions Aug 22 '17 at 18:05
  • \$\begingroup\$ @ETHproductions: Yeah, but I wanted to play with the shiny new shortcut! :D \$\endgroup\$ – Shaggy Aug 22 '17 at 18:07
1
\$\begingroup\$

Octave, 34 bytes

disp(num2str((a=0:15)'*a,'%02x '))
\$\endgroup\$
1
\$\begingroup\$

05AB1E, 17 bytes

16F15ÝN*8o+h€¦ðý»

Try it online!

16F               For N in [0,15]
   15Ý            Push [0, ..., 15]
      N*          Multiply by N
        8o+       Add 256
           h      Take the uppercase hexadecimal representation
            €¦    Remove the leading 1 of each value
              ðý  Join with spaces
                » End for and join everything with newlines

There might be a better way to handle this in 05AB1E.

\$\endgroup\$
  • \$\begingroup\$ 8o can be to save a byte. Although you're right that there might be a better way. :) \$\endgroup\$ – Kevin Cruijssen Mar 21 at 9:42
  • \$\begingroup\$ Indeed! ;) Such commands didn't exist back then; pushing 256 was the 2-byte command žz. See Info.txt on November 12th 2016. Nice to see that the language is still evolving and that people use it :D . \$\endgroup\$ – Osable Mar 22 at 13:32
  • \$\begingroup\$ Ah ok. I knew the small number constants are pretty new, but thought the for 256 was there longer. But I see your answer is from December 2016, so I can understand it wasn't there yet at the time. :) I've seen some 05AB1E answers from 2016 that didn't even had implicit input yet.. \$\endgroup\$ – Kevin Cruijssen Mar 22 at 13:41
1
\$\begingroup\$

C, 61 bytes

i;f(){while(i<256)printf("%02x%c",i%16*(i>>4),++i%16?32:10);}

Wandbox

\$\endgroup\$
  • \$\begingroup\$ is that i implicitly deduced as int a standard feature of C? \$\endgroup\$ – sergiol Jan 4 '17 at 2:17
1
\$\begingroup\$

Python2, 102 97 92 90 89 bytes

i=1
exec"print' '.join('%02x'%(j-x)*(i>0)for x,j in enumerate(range(0,16*i,i)));i+=1;"*16

Output:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e
00 03 06 09 0c 0f 12 15 18 1b 1e 21 24 27 2a 2d
00 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c
00 05 0a 0f 14 19 1e 23 28 2d 32 37 3c 41 46 4b
00 06 0c 12 18 1e 24 2a 30 36 3c 42 48 4e 54 5a
00 07 0e 15 1c 23 2a 31 38 3f 46 4d 54 5b 62 69
00 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78
00 09 12 1b 24 2d 36 3f 48 51 5a 63 6c 75 7e 87
00 0a 14 1e 28 32 3c 46 50 5a 64 6e 78 82 8c 96
00 0b 16 21 2c 37 42 4d 58 63 6e 79 84 8f 9a a5
00 0c 18 24 30 3c 48 54 60 6c 78 84 90 9c a8 b4
00 0d 1a 27 34 41 4e 5b 68 75 82 8f 9c a9 b6 c3
00 0e 1c 2a 38 46 54 62 70 7e 8c 9a a8 b6 c4 d2
00 0f 1e 2d 3c 4b 5a 69 78 87 96 a5 b4 c3 d2 e1

Try it online!

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

SmileBASIC, 56 51 47 bytes

I=RND(16)J=RND(16)LOCATE I*3,J?HEX$(I*J,2)EXEC.
\$\endgroup\$
1
\$\begingroup\$

k, 50 bytes

`0:" "/'("0123456789abcdef"@16 16\)''{x*\:/:x}@!16

Alas, it is hindered by the lack of a built-in hexadecimal printer.

Reading right-to-left, more-or-less:

                                               !16 / make the array {0, 1, 2, ..., 15}
                                     {x*\:/:x}@    / cartesian product of the array multiplied by itself, results in a table
        (                         )''              / for each row, for each column
                            16 16\                 / decode int to two digits in base 16
         "0123456789abcdef"@                       / get the characters to form a string
   " "/'                                           / join the columns with a space, the table is now an array 
`0:                                                / print the array, each element is one line
\$\endgroup\$
1
\$\begingroup\$

///, 588 bytes

/;/\/ //|/\/\///A/00 |B/
A|C;0|D;1|E;2|F;3|G;4|H;5|I;6|J;7|K;8/AAAAAAAAAAAAAAAAB01C2C3C4C5C6C7C8C9CaCbCcCdCeCf B02C4C6C8CaCcCeD0D2D4D6D8DaDcDe B03C6C9CcCfD2D5D8DbDeE1E4E7EaEd B04C8CcD0D4D8DcE0E4E8EcF0F4F8Fc B05CaCfD4D9DeE3E8EdF2F7FcG1G6Gb B06CcD2D8DeE4EaF0F6FcG2G8GeH4Ha B07CeD5 1cE3EaF1F8FfG6GdH4HbI2I9 B08D0D8E0E8F0F8G0G8H0H8I0I8J0J8 B09D2DbE4EdF6FfG8H1HaI3IcJ5JeK7 B0aD4DeE8F2FcG6H0HaI4IeJ8K2Kc 96 B0b 16E1EcF7G2Gd 58I3IeJ9K4Kf 9a a5 B0c 18E4F0FcG8 54I0IcJ8K4 90 9c a8 b4 B0d 1aE7F4G1GeHbI8J5K2Kf 9c a9 b6 c3 B0eDcEaF8G6H4I2J0JeKc 9a a8 b6 c4 d2 B0fDeEdFcGb 5aI9J8K7 96 a5 b4 c3 d2 e1 

A more readable version with newlines:

/]
[///;/\/ //|/\/\///A/00 |B/
A|C;0|D;1|E;2|F;3|G;4|H;5|I;6|J;7|K;8/]
[AAAAAAAAAAAAAAAAB01C2C3C4C5C6C7C8C9CaCbCcCdCeCf ]
[B02C4C6C8CaCcCeD0D2D4D6D8DaDcDe B03C6C9CcCfD2D5D]
[8DbDeE1E4E7EaEd B04C8CcD0D4D8DcE0E4E8EcF0F4F8Fc ]
[B05CaCfD4D9DeE3E8EdF2F7FcG1G6Gb B06CcD2D8DeE4EaF]
[0F6FcG2G8GeH4Ha B07CeD5 1cE3EaF1F8FfG6GdH4HbI2I9]
[ B08D0D8E0E8F0F8G0G8H0H8I0I8J0J8 B09D2DbE4EdF6Ff]
[G8H1HaI3IcJ5JeK7 B0aD4DeE8F2FcG6H0HaI4IeJ8K2Kc 9]
[6 B0b 16E1EcF7G2Gd 58I3IeJ9K4Kf 9a a5 B0c 18E4F0]
[FcG8 54I0IcJ8K4 90 9c a8 b4 B0d 1aE7F4G1GeHbI8J5]
[K2Kf 9c a9 b6 c3 B0eDcEaF8G6H4I2J0JeKc 9a a8 b6 ]
[c4 d2 B0fDeEdFcGb 5aI9J8K7 96 a5 b4 c3 d2 e1 

Pretty simple if you know how /// works. It's just a few string replacements.

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

///, 544 bytes

Well, everyone's doing /// answers now:

/|/\/\///Z/\/ |P/
0B|MZ9|LZ8|KZ7|JZ6|IZ5|HZ4|GZ3|FZ2|EZ1|C/BBB|B/0A|AZ0/0CCCCC0P1A2A3A4A5A6A7A8A9AaAbAcAdAeAfP2A4A6A8AaAcAeE0E2E4E6E8EaEcEeP3A6A9AcAfE2E5E8EbEeF1F4F7FaFdP4A8AcE0E4E8EcF0F4F8FcG0G4G8GcP5AaAfE4E9EeF3F8FdG2G7GcH1H6HbP6AcE2E8EeF4FaG0G6GcH2H8HeI4IaP7AeE5EcF3FaG1G8GfH6HdI4IbJ2J9P8E0E8F0F8G0G8H0H8I0I8J0J8K0K8P9E2EbF4FdG6GfH8I1IaJ3JcK5KeL7PaE4EeF8G2GcH6I0IaJ4JeK8L2LcM6PbE6F1FcG7H2HdI8J3JeK9L4LfMa a5PcE8F4G0GcH8I4J0JcK8L4M0Mc a8 b4PdEaF7G4H1HeIbJ8K5L2LfMc a9 b6 c3PeEcFaG8H6I4J2K0KeLcMa a8 b6 c4 d2PfEeFdGcHbIaJ9K8L7M6 a5 b4 c3 d2 e1

I replaced \s0 through \s9 with A then E through M, 0 0 with C, \n00 0 with P, /\s with Z and finally // with |, adding all these at the front of the code as I went.

Try it online!

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

Python 3, 66 bytes

r=range(16)
for i in r:print(*[('0'+hex(j*i)[2:])[-2:]for j in r])
\$\endgroup\$
1
\$\begingroup\$

Perl 5, 45 bytes

for$"(@a=0..15){printf"%02x ",$_*$"for@a;say}

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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