g | x | w | all
Bytes Lang Time Link
105JavaScript Node.js240809T103533ZFhuvi
072Raku Perl 6 rakudo240808T062815Zbb94
142JavaScript Node.js240808T030309ZAndrew B
021Uiua231022T233836ZBubbler
024Uiua231020T064104Zchunes
016Vyxal220815T235453ZnaffetS
102C gcc220901T080609Zmekb
137Java220816T065407Zmindover
070gbz80 machine code220901T021845ZSNBeast
017Jelly220815T231604ZJonathan
066Ruby220815T051216Zdingledo
02105AB1E220825T073303ZKevin Cr
063Haskell220818T201331Zxnor
100Perl 5220818T152511ZKjetil S
089Haskell220815T100729Zmatteo_c
131C#220817T152222ZAcer
173Dart220817T103106Zlrn
020K ngn/k220815T123345Zngn
081Python220815T050850ZMukundan
188JShell Java220815T131552Zjeffrey.
171Rust220816T093612Zmousetai
077Python220815T171632Zloopy wa
024BQN REPL220815T215706ZDLosc
042V vim220815T150430ZDJMcMayh
080Knight220815T145916ZAiden Ch
036Pyth220815T143637ZMukundan
125sed E220815T140735ZJiří
069PARI/GP220815T071813Zalephalp
020MATL220815T083526ZMukundan
102C GCC220815T092428Zmatteo_c
097Factor + math.matrices220815T065301Zchunes
031Charcoal220815T064014ZNeil
064Retina220815T062538ZNeil
nanJ220815T051316ZJonah

JavaScript (Node.js), 105 bytes

_=>[...Array(4607)].map((e,i)=>`.*R 
`[++i%72?i%9?((i/9|0)%72<8)+(i%72%10==1):3:4]+(i%576?"":`
`)).join``

Try it online!


How it works:
Using 1-dimensional array and indexing to build the string.
The pattern is:

The single characters are stored in a simple string accessed with the corresponding indexes.

Raku (Perl 6) (rakudo), 72 bytes

say [~] map {" .*R".comb[8>$^a%9&$_%9&&($a%%10)+($_%%10)+1]},^71 for ^71

Attempt This Online!

JavaScript (Node.js), 142 bytes

_=>{for(s='',y=0;y<8;y++,s+=`
`)for(j=0;j<8;j++,s+=`
`)for(x=0;x<8;x++,s+=' ')for(i=0;i<8;i++)s+=((x-i)?(y-j)?'.':'*':(y-j)?'*':'R')
return s}

Try it online!

Uiua, 21 bytes

⬚@ ⊏⊞+.♭⊠⊂⊞=.⇡.8".*R"

Try it online!

A port of ngn's K answer, which is also based on Jonah's J but adds a deliberate out-of-bounds indexing trick. With size 4 instead of 8, the following vector is generated:

[1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4]

and its self outer product by addition gives

╭─                                         
╷ 2 1 1 1 5 1 2 1 1 5 1 1 2 1 5 1 1 1 2 5  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  5 4 4 4 8 4 5 4 4 8 4 4 5 4 8 4 4 4 5 8  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  2 1 1 1 5 1 2 1 1 5 1 1 2 1 5 1 1 1 2 5  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  5 4 4 4 8 4 5 4 4 8 4 4 5 4 8 4 4 4 5 8  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  2 1 1 1 5 1 2 1 1 5 1 1 2 1 5 1 1 1 2 5  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  5 4 4 4 8 4 5 4 4 8 4 4 5 4 8 4 4 4 5 8  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  1 0 0 0 4 0 1 0 0 4 0 0 1 0 4 0 0 0 1 4  
  2 1 1 1 5 1 2 1 1 5 1 1 2 1 5 1 1 1 2 5  
  5 4 4 4 8 4 5 4 4 8 4 4 5 4 8 4 4 4 5 8  
                                          ╯

In this matrix, 0, 1, 2 correspond to .*R respectively, and anything larger is a space, so "index into ".*R" with any out-of-bounds indexes mapped to spaces" gives the correct matrix of characters. Any number >= 3 works for the padding; reusing 8 saves a byte over hardcoding any other number (which requires a space between the two numbers).

⬚@ ⊏⊞+.♭⊠⊂⊞=.⇡.8".*R"
              ⊞=.⇡ 8        identity matrix of size 8
        ♭⊠⊂     .         append 8 to each row and flatten
     ⊞+.                    self outer product by addition
    ⊏               ".*R"    select; convert 0, 1, 2 into ".*R"...
⬚@                           and all others to spaces

Uiua, 24 bytes

⊏⊞×.⇌♭≡'⊂0+1⊞=.⇡8" .*xR"

Try it!

Port of @Jonah's J answer. Tip: when looking at the output on the Uiua pad, set the font size to the smallest by clicking the gear in the upper right so you can see the output without line wrapping.

⊏⊞×.⇌♭≡'⊂0+1⊞=.⇡8" .*xR"
                 " .*xR"  # place ascii replacements on the stack
            ⊞=.⇡8         # 8x8 identity matrix
          +1              # increment
      ≡'⊂0                # add column of zeros
     ♭                    # deshape
    ⇌                     # reverse
 ⊞×.                      # outer product
⊏                         # select

Vyxal, 16 bytes

8Þ□›0j:v*` €xR`İ

Try it Online!

Another port of Jonah's answer.

C (gcc), 140 102 bytes

#define a(z,y)for(int z=8;z--;putchar(y+10))
main(){a(i,)a(j,)a(k,22)a(l,i-j|l-k?i==j|l==k?42:46:72);}

Try it online!

#define a(z,y) for (int z=8; z--; putchar(y+10))
main() {
  a(i,) // 10 = space
    a(j,)
      a(k, 22) // 22+10 = 32, space
        a(l,
          (i - j) | (l - k) ? // subtract is quicker than != here
            i == j | l == k ? 42 : // if the x matches xor the y matches, print asterisk
              46 : // if neither match, print dot
                72); // if both match, print R, only the last number has 10 added in the macro, so 82
}

Java, 151 145 137 bytes

for(int y=0,x,a,b;++y<72;){var s="";for(x=1;x<72;s+=x++%9*(y%9)<1?' ':a+b<1?'R':a*b<1?'*':'.'){a=~-x%10;b=~-y%10;}System.out.println(s);}

Attempt This Online! Link is to a "normal" Java version, as I don't know if the link to the online JShell will stay valid.

Jeffrey's answer made me aware of JShell, which saves a couple of bytes compared to a lambda function or an interface. EDIT It also reminded me that ternary ifs don't always need parentheses. Thanks!

-8 bytes thanks to @ceilingcat!

gbz80 machine code, 73 72 70 bytes

21 00 C0 06 00 0E 00 16 00 1E 00 36 00 78 B9 20
01 34 7A BB 20 01 34 AF BE 28 08 3C BE 28 08 3E
52 18 06 3E 2E 18 02 3E 2A 22 3E 08 1C BB 20 DB
36 20 23 14 BA 20 D2 36 0A 23 0C B9 20 C9 36 0A
23 04 B8 20 C0 76

As an ASM rookie, I gladly accept.

The string is returned in $C000-$D247 ($1248 long, nice). You may check it by copying that range using an emulator debugger (it finishes very quickly, you'll know it's done if the program counter is on or after the halt) into a text file and opening it with a text editor that supports LF. The emulator I used is BGB.

This code can be placed anywhere in a ROM and jumped to from the entrypoint, or called as a routine if the $76 (halt) at the end is replaced with a $C9 (ret).

Source, which may be assembled with RGBDS:

section "Header", ROM0[$100]
    jr GenerateMetaTable    ; the generated binary could be placed anywhere because of the lack of calls and jps

    ds $150 - @, 0          ; Make room for the header

GenerateMetaTable:
    ld hl, LotsaSpace
    ld b, 0                 ; meta-line tracker. each of these hardcoded zeroes is necessary because all of these registers change
.outermost:
    ld c, 0                 ; sub-line tracker
.mediumOuter:
    ld d, 0                 ; meta-row tracker
.mediumInner:
    ld e, 0                 ; sub-row tracker
.innermost:
    ld [hl], 0              ; we're out of registers (besides a which is used for comparing), but we have this convenient value we're pointing to that will get overwritten anyway.
    ld a, b
    cp a, c                 ; meta-line == sub-line -> rook move or rook position
    jr nz, .skipFirstInc
    inc [hl]
    .skipFirstInc:
    ld a, d
    cp a, e                 ; meta-row == sub-row -> rook move or rook position
    jr nz, .skipSecondInc
    inc [hl]
    .skipSecondInc:
    xor a, a
    cp a, [hl]
    jr z, .period           ; [hl] == 0 -> neither rook position nor rook move
    inc a
    cp a, [hl]
    jr z, .star             ; [hl] == 1 -> rook move
    ld a, "R"               ; [hl] == 2 -> rook position
    jr .write
.period:
    ld a, "."
    jr .write
.star:
    ld a, "*"
.write:
    ld [hl+], a
.innermostEnd:
    ld a, 8
    inc e
    cp a, e
    jr nz, .innermost
    ld [hl], " "
    inc hl
.mediumInnerEnd:
    inc d
    cp a, d
    jr nz, .mediumInner
    ld [hl], "\n"
    inc hl
.mediumOuterEnd:
    inc c
    cp a, c
    jr nz, .mediumOuter
    ld [hl], "\n"
    inc hl
.outermostEnd:
    inc b
    cp a, b
    jr nz, .outermost
HangMachine:
    db $76                  ; directly encoded halt, saves one byte over "halt", which automatically adds a nop
                            ; this is here to prevent the program from repeating endlessly. that may not seem problematic, but if a tester stops it while [hl] is being used to hold the match count, they'll copy a bad output.
                            ; to make GenerateMetaTable a function, just replace this with "ret"

section "Memory", WRAM0
LotsaSpace:
    ; we need $1248 of space, but we can't just ds it because WRAM0 is $1000 long. no formalism for you. we don't bank-switch ever, so it's not a problem.

Edit 1: "ld a, 0" -> "xor a, a", -1 byte

Edit 2: rearranging character loading jumps allowed removal of one, -2 bytes

Jelly, 17 bytes

8⁼þj-‘×þ`ị“.* R ”

A niladic Link that yields a list of the lines of characters. The empty lines have trailing spaces.

Try it online! (Footer joins with newlines)

How?

Implements Jonah's brilliant method.

8⁼þj-‘×þ`ị“.* R ” - Link: no arguments
8                 - 8
  þ               - ([1..8]) table ([1..8]) with:
 ⁼                -   is equal?
    -             - -1
   j              - join
     ‘            - increment all values
        `         - use as both arguments of:
       þ          -   table with:
      ×           -     multiply
          “.* R ” - ".* R "
         ị        - index into (1-indexed and modular, so 0 gives ' ')

Ruby, 67 66 bytes

-1 byte thanks to @G B

A function that returns a list of lists.

->{(a=0..70).map{|x|a.map{'.*R '[x%9|_1%9<8?1[x%10]+1[_1%10]:3]}}}

Attempt This Online!

Ruby, 69 bytes

Alternatively, outputting the string to STDOUT takes two extra bytes.

71.times{|x|71.times{$><<'.*R '[x%9|_1%9<8?1[x%10]+1[_1%10]:3]};puts}

Attempt This Online!

05AB1E, 21 bytes

8LδQ>0δª˜Dδ*" .*xR"sè

Another port of @Jonah's J answer, so make sure to upvote him as well!

Try it online. (Footer is to pretty-print the resulting matrix of characters.)

Explanation:

8LδQ          # Push an 8x8 equality matrix (8x8 of 0s, with main diagonal of 1s):
8L            #  Push list [1,2,3,4,5,6,7,8]
              #  (implicitly use it twice since there isn't anything else on the stack)
  δ           #  Apply double-vectorized:
   Q          #   Equality check
    >         # Increase each by 1
      δ       # Map over each row:
     0 ª      #  Append a 0 to the row
˜             # Flatten the matrix to a single list
 D            # Duplicate it
  δ           # Apply double-vectorized again:
   *          #  To create a multiplication matrix
    " .*xR"   # Push this string
           s  # Swap so the matrix is at the top of the stack
            è # Index the matrix into the string
              # (after which the result is output implicitly)

Haskell, 63 bytes

q["",q" .*",q" *R"]
q l=[l!!(0^m 10-0^m 9+1)|m<-mod<$>[10..80]]

Try it online!

Perl 5, 100 bytes

print$_%72?$_/72%9?$_%9?($v=1==$_%72%10)&($h=1==$_/72%9-$_/648)?R:$v|$h?'*':'.':$":'':$/for 73..5184

Try it online!

Haskell, 99 90 89 bytes

[[" R*."!!((f(i%10)+f(k%10)+1)*f(k%9*i%9))|k<-r]|i<-r]
(%)=mod
f=fromEnum.(>0)
r=[10..81]

Attempt This Online!

C#, 131 bytes

_=>{T[]F<T>(T x,T y,T z)=>new T[72].Select((_,i)=>i%10<1?x:i%9<8?y:z).ToArray();return F(F("R","*"," "),F("*","."," "),new[]{""});}

Try it online!


Makes use of an inline generic function:

_ => {
    /* both the characters within each row and the rows in the whole string follow the same pattern
     a default string, a different string at every 10th string,
     and a space string at every 9th string, starting at 8

    e.g. R******* *R****** **R***** ***R**** ****R*** *****R** ******R* *******R
    the default string is "*", the special character is "R" and the space is " "

    for the whole result string, the default string is "*....... .*...... [...]"
    the special string is "R******* *R****** [...]" and the space is either "" or " " (both work)

    */

    // generic function (defines T as the generic type), inputs of type T
    T[] F<T> (T specialChar, T defaultChar, T space) => 
    // create a new T[] of length 72, and set each element according to its index
    new T[72]
        .Select((_, i) => 
            // special char every 10th element
            i % 10 < 1 ? specialChar : 
                // space every 9 starting at 8, otherwise default
                i % 9 < 8 ? defaultChar : space
        ).ToArray();


    // construct rook (special) row string
    var a = F("R", "*", " ");
    // construct default row string
    var b = F("*", ".", " ");
    // correctly typed space for next func call
    var c = new string[] { "" };

    // construct whole string using default, special and space strings
    return F(a, b, c);
};

Dart, 173 bytes

main(){var l=[0,1,2,3,4,5,6,7],s="R"+"*"*7+"*......."*7,p=" "*7+"\n",i,j,k,m;print([for(i in l)...[for(j in l)for(k in l)...[for(m in l)s[(k^m)*8+i^j],p[k]],"\n"]].join());}
//       1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         7            
//345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123

Pretty-printed:

main() {
  var l = [0, 1, 2, 3, 4, 5, 6, 7],
      s = "R" + "*" * 7 + "*......." * 7,
      p = " " * 7 + "\n",
      i, j, k, m;
  print([
    for (i in l) ...[
      for (j in l)
        for (k in l) ...[for (m in l) s[(k ^ m) * 8 + i ^ j], p[k]],
      "\n"
    ]
  ].join());
}

K (ngn/k), 34 32 30 24 20 bytes

".*R"a+\:a:,/|+|3,=8

Try it online!

idea from jonah's solution

=8 identity matrix

3, prepend a 3

| reverse

+ transpose (this will extend the 3 to eight copies)

| reverse again

,/ raze

a: assign to a

a+\: add-each-right, i.e. make a matrix in which element i,j is a[i]+a[j]

".*R" index into this string. out-of-bounds indices generate " "-s in the result.

Python, 86 83 82 81 bytes

lambda r=range(71):[[" .*R"[i%9|j%9<8and(i%10<1)-~(j%10<1)]for i in r]for j in r]

Attempt This Online!

-1 byte thanks to @loopy walt

JShell (Java), 191 188 bytes

void f(String x){System.out.print(x);}int i,j,x,y;for(j=0;j<8;j++){for(y=0;y<8;y++){for(i=0;i<8;i++){for(x=0;x<8;x++){int X=i^x,Y=j^y;f(X*Y<1?X+Y<1?"R":"x":".");}f(" ");}f("\n");}f("\n");}

Or, expanded:

void f(String x) {
    System.out.print(x);
}

int i, j, x, y;
for (j = 0; j < 8; j++) {
    for (y = 0; y < 8; y++) {
        for (i = 0; i < 8; i++) {
            for (x = 0; x < 8; x++) {
                int X = i ^ x;
                int Y = j ^ y;
                f(X * Y < 1 ? X + Y < 1 ? "R" : "x" : ".");
            }
            f(" ");
        }
        f("\n");
    }
    f("\n");
}

Rust, 171 bytes

||(0..71).any(|x|(0..72).map(|y|(x/9,y/9,x%9,y%9,y/71+1)).any(|(x,y,a,b,l)|print!("{:
<1$}",if a>7||b>7{' '}else if x==a&&y==b{'R'}else if x==a||y==b{'*'}else{'.'},l)>()))

Playground Link

Python, 77 bytes (@xnor)

f=lambda*_:[[" ",I[i%10<1]][i%9<8]for i in range(71)]
I=f(I:='.*'),f(I:='*R')

Attempt This Online!

Previous Python, 79 bytes

J=[]
f=lambda I=J:[" "[~i%9:]or I[i%10<1]for i in range(71)]
J+=f('.*'),f('*R')

Attempt This Online!

Previous Python, 80 bytes

J=[]
f=lambda I=J:sum(zip(*8*[iter(8*(I+7*I[1:]))],8*' '),())
J+=f('R*'),f('*.')

Attempt This Online!

This uses the good old grouper to create lots of 8 and to mix in the separators.

BQN (REPL), 24 bytes

" .*xR"⊏˜×⌜˜⥊∾⟜0˘1+=⌜˜↕8

Outputs a 2D array of characters. Try it at BQN online!

Explanation

Ports Jonah's J solution, which you should upvote.

" .*xR"⊏˜×⌜˜⥊∾⟜0˘1+=⌜˜↕8
                        ↕8  Range(8)
                     =⌜˜    Equality table with self (8x8 identity matrix)
                   1+       Add 1 to each (main diagonal is 2s, rest is 1s)
               ∾⟜0˘        Append 0 to each row
             ⥊              Deshape into a flat list
          ×⌜˜               Multiplication table with self
       ⊏˜                   Use each element of that 2D array to index into
" .*xR"                     this string

Just for fun, here's a different solution (27 bytes) that outputs a 2D array of 2D arrays of characters (feels appropriate, but goes against the challenge's I/O requirements and also is longer):

{".*R"⊏˜r(+´𝕨‿𝕩=⋈)⌜r}⌜˜r←↕8

Try it at BQN online!

V (vim), 42 bytes

iR·* 7o*·. {7ñä}$FR7jdpbñGï{7ñäGGkdd{p

Try it online!

Hexdump:

00000000: 6952 b72a 201b 376f 2ab7 2e20 1b7b 37f1  iR.* .7o*.. .{7.
00000010: e416 7d24 4652 1637 6a64 7062 f147 ef7b  ..}$FR.7jdpb.G.{
00000020: 37f1 e447 476b 6464 7b70                 7..GGkdd{p

Knight, 80 bytes

;=i~1W>8=i+1i;=j~1;W>8=j+1j;=x~1;W>8=x+1xO+I?j iS*'*'8xT'R'S*'.'8xT'*'' \'O''O''

Try It Online!

Pyth, 36 bytes

VJU71sm@>".*R "+!%NT!%dT_<7.|%d9%N9J

Try it online!

sed -E, 125 bytes

s/^/Rssssssss/
s/.*/&&&&&&&&/
s/.{8}$//
s/.{8}/& /g
y/s/*/
h
y/R*/*./
H;H;H;H;H;H;H;H
g;H;H;H;G;G
s/.{584}/&\n/g
s/.{1244}$//

Attempt This Online!

PARI/GP, 69 bytes

f()=matrix(71,,i,j,Vec(".*R ")[if(i%9&&j%9,(i%10==1)+(j%10==1)+1,4)])

Attempt This Online!

MATL, 26 25 24 21 20 bytes

'.*xR '8XyQO9Y(le&*)

Try it online!

-3 bytes thanks to @Luis Mendo

Explanation

Port of @Jonah answer to MATL

'.*xR '8XyQO9Y(le&*)
       8Xy              % 8 x 8 identity matrix
          Q             % add one
           O9Y(         % add a row of zeros to the end
               le       % flatten
                 &*     % multiply with itself
'.*xR '            )    % convert numbers to required codepoints

C (GCC), 102 bytes

main(i,k){for(i=9;++i<82;puts(""))for(k=9;++k<82;)putchar(k%9&&i%9?i%10|k%10?i%10&&k%10?46:42:82:32);}

Attempt This Online!

C (GCC), 111 109 107 bytes

#define F(X,c)for(X=0;++X<9;putchar(c))
main(i,j,k,l){F(i,10)F(j,10)F(k,32)F(l,i-j|k-l?i-j&&k-l?46:42:82);}

Attempt This Online!

Factor + math.matrices, 97 bytes

[ 8 identity-matrix 1 m+n [ 0 suffix ] map
concat dup outer [ "\0"" .*R"zip substitute ] map ]

Try it online!

A straight translation of @Jonah's excellent J answer.

Charcoal, 31 bytes

E⁷¹⭆⁷¹§ .*R∧﹪⊕ι⁹∧﹪⊕λ⁹⊕⁺¬﹪ιχ¬﹪λχ

Try it online! Link is to verbose version of code. Explanation:

 ⁷¹                             Literal integer `71`
E                               Map over implicit range
    ⁷¹                          Literal integer `71`
   ⭆                            Map over implicit range and join
        .*R                     Literal string ` .*R`
      §                         Indexed by
              ι                 Current row
             ⊕                  Incremented
            ﹪                   Modulo
               ⁹                Literal integer `9`
           ∧                    Logical And
                   λ            Current column
                  ⊕             Incremented
                 ﹪              Modulo
                    ⁹           Literal integer `9`
                ∧               Logical And
                         ι      Current row
                        ﹪       Modulo
                          χ     Predefined variable `10`
                       ¬        Logical Not
                      ⁺         Plus
                             λ  Current column
                            ﹪   Modulo
                              χ Predefined variable `10`
                           ¬    Logical Not
                     ⊕          Incremented
                                Implicitly print

Actually using ASCII art drawing commands seems to take 51 bytes: Try it online! Link is to verbose version of code.

Retina, 64 bytes


R7*$(9*$*R)7*$(¶9*$($*7*$(9*.$*)¶)R7*$(9*$*R
%8,9,`.
 
8,9,`.+

Try it online! Explanation:


R7*$(9*$*R)7*$(¶9*$($*7*$(9*.$*)¶)R7*$(9*$*R

Replace the empty input with the pattern of Rs, *s and .s. Note that * is Retina 1's string repetition operator so actual *s have to be quoted as $*.

%8,9,`.
 

Clear out every ninth column.

8,9,`.+

Clear out every ninth row.

J, 29 27 24 23 bytes

' .*xR'{~*/~,0,.~1+=i.8

Try it online!

My initial observation was that the output is essentially a row-wise function table of the 8x8 identity matrix with itself, where each evaluation is simply an ordinary addition table: row_i +/ row_j.

This can be simplified further by flattening the identity matrix first, as follows: