3
$\begingroup$

How could I rewrite the following code such that the output (evaluation result) is the same, but is obtained from code having less than 30 characters in total?

Table[Table[{b - a, b}, {b,8}],{a,8}],

I tried for more than an hour, but I can't find the solution to this problem.

$\endgroup$
1
  • 3
    $\begingroup$ Table[{b - a, b}, {a, 8}, {b, 8}] is 26 characters. $\endgroup$
    – bill s
    Feb 26, 2019 at 17:26

1 Answer 1

11
$\begingroup$

is 22 chars ok?

{#2-#,#2}&~Array~{8,8}
$\endgroup$
2
  • $\begingroup$ Thank you to both of you, it worked! :D $\endgroup$
    – user63131
    Feb 26, 2019 at 17:38
  • $\begingroup$ code-golf is fun! $\endgroup$
    – ZaMoC
    Feb 26, 2019 at 17:44

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