[Question]
  [
Write a program or function that takes in three positive integers, W, H, and N. Print or return a W×H grid of `.`'s where every Nth `.` in normal English reading order is replaced with an `X`.
For example, given W = 7, H = 3, N = 3, the grid is 7 characters wide and 3 high, and every third character reading from the top left is an `X`:
```
..X..X.
.X..X..
X..X..X
```
Similarly, if the input is W = 10, H = 4, N = 5, the output would be:
```
....X....X
....X....X
....X....X
....X....X
```
### Notes
* "Normal English reading order" means going left to right on each line, from the top line to the bottom.
* When N is 1 then all the `.`'s will become `X`'s.
* You may use any two distinct [printable ASCII](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) characters in place of `.` and `X`.
	+ If you use space () then trailing spaces are not required when the result would be visually the same. (Empty lines are still required.)
	+ You may not using something else in place of the newlines that shape the grid.
* The exact input format and order of W, H, and N is not super important. Things like `[H,W,N]` or `N\nW,H` are alright.
* A trailing newline in the output is fine.
* The shortest code in bytes wins!
# Examples
```
W = 5, H = 3, N = 1
XXXXX
XXXXX
XXXXX
W = 5, H = 3, N = 2
.X.X.
X.X.X
.X.X.
W = 5, H = 3, N = 3
..X..
X..X.
.X..X
W = 5, H = 3, N = 4
...X.
..X..
.X...
W = 5, H = 3, N = 5
....X
....X
....X
W = 5, H = 3, N = 6
.....
X....
.X...
W = 5, H = 3, N = 7
.....
.X...
...X.
W = 5, H = 3, N = 15
.....
.....
....X
W = 5, H = 3, N = 16 (or more)
.....
.....
.....
W = 1, H = 1, N = 1
X
W = 1, H = 1, N = 2 (or more)
.
W = 8, H = 6, N = 2
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X
W = 8, H = 6, N = 3
..X..X..
X..X..X.
.X..X..X
..X..X..
X..X..X.
.X..X..X
W = 8, H = 6, N = 4
...X...X
...X...X
...X...X
...X...X
...X...X
...X...X
W = 8, H = 6, N = 7
......X.
.....X..
....X...
...X....
..X.....
.X......
W = 8, H = 6, N = 16
........
.......X
........
.......X
........
.......X
W = 37, H = 1, N = 4
...X...X...X...X...X...X...X...X...X.
W = 1, H = 10, N = 8
.
.
.
.
.
.
.
X
.
.
```
  
[Answer]
#  J, ~~9~~ 5 bytes
```
$":&1
```
Uses spaces and `1`'s and expects input in the form `H W f N`
Explanation:
```
$":&1
   &1 bonds the fixed right argument 1 to ":
 ":   formats the right argument number (1) to take up left argument (N) number of cells
      padding with spaces, resulting  in "  1"
$     reshape to H-by-W with repeating the string if necessary 
```
Usage:
```
   3 7 ($":&1) 3
  1  1 
 1  1  
1  1  1
```
[Try it online here.](http://tryj.tk/) 
[Answer]
# Python 2, 60 bytes
```
w,h,n=input()
s='%%%dd'%n%0*w*h
exec"print s[:w];s=s[w:];"*h
```
This prints space and `0` in place of `.` and `X`. Input is taken as a tuple in the form of `w,h,n`.
[Answer]
## J, 12 bytes
```
$'X'_1}#&'.'
```
This is a dyadic function that takes the array `H W` as its left argument and `N` as its right argument. Usage:
```
  f =: $'X'_1}#&'.'
  3 5 f 3
..X..
X..X.
.X..X
```
### Explanation
```
$'X'_1}#&'.'
         '.'  The character '.'
       #&     repeated N times
    _1}       with the last character
 'X'          replaced by 'X'
$             reshaped into an HxW array
```
[Answer]
# BBC Basic, 67 ASCII characters, tokenised filesize 43 bytes
Download interpreter at <http://www.bbcbasic.co.uk/bbcwin/download.html>
```
INPUTw,h,n:WIDTHw:PRINTLEFT$(STRING$(w*h,STRING$(n-1,".")+"X"),w*h)
```
BBC basic has a handy command for limiting the field width. We use `STRING$` to make `w*h` copies of the string of `n-1` periods followed by an X. Then we use LEFT$ to truncate this to `w*h` characters.
[Answer]
## [Minkolang 0.14](https://github.com/elendiastarman/Minkolang), ~~34~~ ~~30~~ ~~28~~ 22 bytes
```
n2-D1n$zn[z[1Rd6ZO]lO]
```
[Check one case here](http://play.starmaninnovations.com/minkolang/?code=n2-D1n%24zn%5Bz%5B1Rd6ZO%5DlO%5D&input=3%205%203) and [check all test cases here.](http://play.starmaninnovations.com/minkolang/?code=%28ndN2-D1ndN%24zndNlO%5Bz%5B1Rd6ZO%5DlO%5DlOlOIX%24I%29%2E&input=1%205%203%0A2%205%203%0A3%205%203%0A4%205%203%0A5%205%203%0A6%205%203%0A7%205%203%0A15%205%203%0A16%205%203%0A1%201%201%0A2%201%201%0A2%208%206%0A3%208%206%0A4%208%206%0A7%208%206%0A16%208%206) Expects input like `N W H`.
### Explanation
```
n                 Take number from input (N)
 2-               Subtract 2
   D              Duplicate the top of stack (which is 0 because it's empty) N-2 times
    1             Push a 1 onto the stack
n                 Take number from input (W)
 $z               Store W in the register (z)
n                 Take number from input (H)
 [                Open a for loop that repeats H times
  z[              Open a for loop that repeats W times
    1R            Rotate 1 step to the right
      d           Duplicate top of stack
       6Z         Convert number to string
         O        Output as character
          ]       Close for loop
           lO     Output a newline
             ]    Close for loop
```
As Minkolang's codebox is toroidal, this will wrap around to the beginning. As every `n` will now take in `-1`, this eventually crashes with an error and no further output, which is allowed.
[Answer]
## CJam (16 bytes)
```
{1$*,:)@f%:!/N*}
```
Takes input on the stack in the order `N W H`, returns string using characters `0` and `1`. [Online demo](http://cjam.aditsu.net/#code=3%207%203%0A%0A%7B1%24*%2C%3A)%40f%25%3A!%2FN*%7D%0A%0A~)
### Dissection
```
{        e# Anonymous function. Stack: N W H
  1$*,   e# Stack: N W [0 1 ... W*H-1]
  :)     e# Stack: N W [1 2 ... W*H]
  @f%    e# Stack: W [1%N 2%N ... W*H%N]
  :!     e# Map Boolean not, taking 0 to 1 and anything else to 0
  /      e# Split into W-sized chunks (i.e. the lines of the grid)
  N*     e# Join the lines with newlines
}
```
[Answer]
## APL, 13 bytes
```
{‚ç™,/‚çï¬®‚ç∫‚ç¥‚çµ=‚ç≥‚çµ}
```
This takes `H W` as the left argument and `N` as the right argument.
Explanation:
```
{‚ç™,/‚çï¬®‚ç∫‚ç¥‚çµ=‚ç≥‚çµ}     Dyadic function (args are ‚ç∫ on left, ‚çµ on right):
        ‚çµ=‚ç≥‚çµ      ‚çµ = (1 2 3...‚çµ); this is ‚çµ-1 0s followed by a 1
      ‚ç∫‚ç¥          Shape by the left argument; e.g. 5 3 gives a 5x3 array
    ‚çï¬®            Stringify each entry
  ,/              Join the strings in each row 
 ‚ç™                Make column vector of strings
```
Try it online: [first test cases](http://tryapl.org/?a=%7B%u236A%2C/%u2355%A8%u237A%u2374%u2375%3D%u2373%u2375%7D/%A8%20%28%28%u2282%u22823%205%29%2C%A8%28%u23737%29%2C15%2C16%29%2C%28%28%u2282%u22826%208%29%2C%A82%203%204%207%29&run), [last test case](http://tryapl.org/?a=1%2037%7B%u236A%2C/%u2355%A8%u237A%u2374%u2375%3D%u2373%u2375%7D4&run). Note that although this shows boxed output, my copy of Dyalog doesn't.
[Answer]
# CJam, 20 Bytes
```
q~:Z;_@*,:){Z%!}%/N*
```
Takes input as H W N.
[Answer]
# K, ~~21~~ ~~19~~ ~~18~~ 14 bytes
Takes arguments as `(H W;N)`:
```
{".X"x#y=1+!y}
```
In action:
```
  f:{".X"x#y=1+!y};
  f.'((3 5;1);(3 5;2);(3 7;3);(4 10;5);(3 5;16))
(("XXXXX"
  "XXXXX"
  "XXXXX")
 (".X.X."
  "X.X.X"
  ".X.X.")
 ("..X..X."
  ".X..X.."
  "X..X..X")
 ("....X....X"
  "....X....X"
  "....X....X"
  "....X....X")
 ("....."
  "....."
  "....."))
```
[Answer]
# MATLAB, ~~61 55~~ 54 bytes
```
function c=g(d,n);b=ones(d);b(n:n:end)=0;c=[b'+45,''];
```
Wow, I thought MATLAB would be competitive in this one, but how wrong I was!
The function creates an array of 1's of the correct dimensions, and then sets every n'th element to be 0 (MATLAB implicitly handles wrapping around the indices into 2D). We then add on 45 ('-') to this number and converted to a char array to be returned.
The questions allows any distinct two ASCII characters to be used for the grid, I am using '-' in place of 'x' to save some bytes. The input format is also not fixed, so it should be supplied as `[w h],n` - i.e. an array of width and height, and then n as a second parameter.
---
This also works with **Octave** and can be tried online [here](http://octave-online.net/?s=QHPazBNGkfyhbhbdFrYAnJeGZmDvKMKYapOgHyikJRbmUTQP). The function is already set up in the linked workspace, so you can simply call for example:
```
g([4,5],3)
```
Which outputs:
```
..-.
.-..
-..-
..-.
.-..
```
[Answer]
## Processing, 93 bytes (Java, 104 bytes)
```
void f(int a,int b,int c){for(int i=0;i<a*b;i++)print((i%c>c-2?"X":".")+(i%a>a-2?"\n":""));}}
```
The reason I used Processing instead of Java is that you don't need to acces the pointer by tiping `System.out` because a local variable is directly accessible. I earned 11 bytes with this. The function doesn't return the result but prints it.
[Answer]
# [Japt](https://github.com/ETHproductions/Japt), ~~33~~ ~~32~~ ~~27~~ 25 bytes
```
SpW-1 +Q p-~U*V/W f'.pU)¬∑
```
Takes input in format `W H N`. Uses `¬†` and `"` in place of `.` and `X`, respectively. [Try it online!](https://codegolf.stackexchange.com/a/62685/42545)
### Ungolfed and explanation
```
SpW-1 +Q p-~U*V/W f'.pU)¬∑qR
          // Implicit: U = width, V = height, W = interval
SpW-1 +Q  // Create a string of W - 1 spaces, plus a quotation mark.
p-~U*V/W  // Repeat this string ceil(U*V/W) times.
f'.pU)    // Split the resulting string into groups of U characters.
qR        // Join with newlines.
          // Implicit: output last expression
```
Suggestions welcome!
[Answer]
# [Vitsy](https://github.com/VTCAKAVSMoACE/Vitsy), ~~25~~ ~~23~~ ~~22~~ ~~21~~ 19 Bytes
Thanks to @Sp3000 for pointing out that I don't need a duplicate and saving me 2 bytes!
Takes input as `N W H`. [Try it online!](http://vitsy.tryitonline.net/#code=MX1cMFhyVlxbVlxbe0ROXWFPXQ&input=&args=Mw+Nw+NA&debug=on)
```
1}\0XrV\[V\[{DN]aO]
1                         Push 1 to the stack.
 }                        Push the backmost to the front and subtract 2.
  \0X                     Duplicate the 0 temp variable times.
     r                    Reverse the stack.
      V                   Save as final global variable.
       \[         ]       Repeat top item times.
         V\[   ]          Repeat global variable times.
            {DO           Duplicate, output, then shift over an item.
                aO        Output a newline.
```
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 10 bytes
```
{y#|x$"X"}
```
[Try it online!](https://ngn.codeberg.page/k#eJyNkV1rgzAUhu/zK4LrhYUaa/0aht3valeDBUqhYtVKP+zUDaXbfvs8OanVTrZJyHvCefKeN5gE5+buo55oQvsk5Dk4T5bNVxEklNGar/Md19dJmO15zRteTFfALHWb29Sfcl2jVMDSuIYFVFgIbboC1OUOtebIyga0+P8O6GC1w1wwEPDBgIEitLhA7V2BKQTayTNCdgf1o17CK8i5QqqpYJmqe9UVuqbuFCGvD6lxP5z8WwibXI1vIWKSbVWdysA0o3wTp/k+YWUVRru4jrbhMY1ZlB/M17e4rLL8WJqea3n35ntcNEaZHU772EiLbGMcwmJXEvJCH6g/o4+t2DP6BEIYE7AICiMoAmFrjrSDtNvSsg3An6V0cAfjLCL/22AfwRaQRkAWAZayHsFUeNJ7wBjmEIaAhGW6MUw9brCPYJ5syaG/ufkKQ0AG+Aa9lbne)
Takes input as two arguments; `N` as the first/left arg, and `(H;W)` as the second/right arg. Uses `" "` and `"X"` as the output characters.
* `|x$"X"` right pad "X" to the desired length (fills with spaces), and reverse it (to put the "X" at the end)
* `y#` reshape the above to the desired dimensions; the above gets repeated over and over until it is long enough
[Answer]
# Pyth - ~~19~~ ~~18~~ 17 bytes
Hope to golf it more. Takes input as `N\n[W, H]`.
```
jc.[k+*dtvzN*FQhQ
```
[Test Suite](http://pyth.herokuapp.com/?code=jc.%5Bk%2B%2adtvzN%2aFQhQ&test_suite=1&test_suite_input=3%0A7%2C3%0A5%0A10%2C4%0A1%0A7%2C3&debug=0&input_size=2).
[Answer]
# R, 66 bytes
```
function(w,h,n){x=rep(".",a<-w*h);x[1:a%%n<1]="X";matrix(x,h,w,T)}
```
This is a function that accepts three integers and returns a matrix of character values. To call it, assign it to a variable.
Ungolfed:
```
f <- function(w, h, n) {
    # Get the area of the square
    a <- w*h
    # Construct a vector of dots
    x <- rep(".", a)
    # Replace every nth entry with X
    x[1:a %% n == 0] <- "X"
    # Return a matrix constructed by row
    matrix(x, nrow = h, ncol = w, byrow = TRUE)
}
```
[Answer]
# JavaScript (ES6), ~~65~~ 60 bytes
```
(w,h,n)=>eval('for(i=r=``;i++<w*h;i%w?0:r+=`\n`)r+=i%n?0:1')
```
## Explanation
```
(w,h,n)=>eval('    // use eval to remove need for return keyword
  for(
    i=             // i = current grid index
      r=``;        // r = result
    i++<w*h;       // iterate for each index of the grid
    i%w?0:r+=`\n`  // if we are at the end of a line, print a newline character
                   // note: we need to escape the newline character inside the template
  )                //       string because this is already inside a string for the eval
    r+=i%n?0:1     // add a 0 for . or 1 for X to the result
                   // implicit: return r
')
```
## Test
```
W = <input type="number" id="W" value="7" /><br />
H = <input type="number" id="H" value="3" /><br />
N = <input type="number" id="N" value="3" /><br />
<button onclick="result.innerHTML=(
(w,h,n)=>eval('for(i=r=``;i++<w*h;i%w?0:r+=`\n`)r+=i%n?0:1')
)(+W.value,+H.value,+N.value)">Go</button>
<pre id="result"></pre>
```
[Answer]
## Mathematica, 85 bytes
```
""<>(#<>"
"&/@ReplacePart["."~Table~{t=# #2},List/@Range[#3,t,#3]->"X"]~Partition~#)&
```
As with many other solutions, this creates a single row, then partitions it.
[Answer]
# JavaScript (ES6), 55 bytes
```
(w,h,n)=>(f=i=>i++<w*h?+!(i%n)+(i%w?"":`
`)+f(i):"")(0)
```
Uses the [IIFE](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression "Immediately-Invoked Function Expression") `f` to loop to save a return statement.
Output for w=5, h=3, n=7:
```
00000
01000
00010
```
[Answer]
**C#, 185 bytes**
```
using System;class x{void a(int w,int h,int n){int c=1;for(int i=0;i<h;i++){for(int j=1;j<=w;j++){if(c%n==0){Console.Write("x");}else{Console.Write(".");}c++;}Console.WriteLine();}}}
```
For a more readable Reading:
```
using System;
class x
{
  void a(int w, int h, int n)
  {
    int c = 1;
    for (int i = 0; i < h; i++)
    {
        for (int j = 1; j <= w; j++)
        {
            if (c % n == 0)
            {
                Console.Write("x");
            }
            else
            {
                Console.Write(".");
            }
            c++;
        }
        Console.WriteLine();
     }
  }
}
```
Usage:
```
new x().a(7, 3, 3);
```
[Answer]
# [Vyxal 3](https://github.com/Vyxal/Vyxal/tree/version-3) `jR`, 8 bytes
```
√ó∆õ?·∏ä]¬π·∫Ü‚Äú
```
input as `W,H,N`
[Try it Online!](https://vyxal.github.io/latest.html#WyJqUiIsIiIsIsOXxps/4biKXcK54bqG4oCcIiwiIiwiM1xuN1xuMyIsIjMuNC4xIl0=)
```
√ó∆õ?·∏ä]¬π·∫Ü‚Äú¬≠‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å°‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å™‚Äè‚Å†‚Å™‚Å™‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å¢‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å£‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å§‚Äã‚Äé‚Äè‚Äã‚Å¢‚Å†‚Å°‚Äå¬≠
√ó∆õ  ]     # ‚Äé‚Å°Map over the range H x W
  ?·∏ä      # ‚Äé‚Å¢Divisible by N?
     ¬π·∫Ü‚Äú  # ‚Äé‚Å£Split into chunks of length W and join on nothing
# ‚Äé‚Å§j flag joins on newlines
üíé
```
Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
[Answer]
# Julia, 50 bytes
```
f(w,h,n)=reshape([i%n<1?"X":"." for i=1:w*h],w,h)'
```
This creates a function `f` that accepts three integers and returns a 2-dimensional array of strings.
Ungolfed:
```
function f(w::Integer, h::Integer, n::Integer)
    # Construct an array of strings in reading order
    a = [i % n == 0 ? "X" : "." for i = 1:w*h]
    # Reshape this columnwise into a w√óh array
    r = reshape(a, w, h)
    # Return the transpose
    return transpose(r)
end
```
[Answer]
# Ruby, ~~67~~ 56 bytes
```
->w,h,n{(1..h).map{(1..w).map{o,$.=$.%n<1?1:0,$.+=1;o}}}
```
Printing an array since it is accepted.
**67 bytes**
```
->w,h,n{i=1;puts (1..h).map{(1..w).map{o,i=i%n<1?1:0,i+=1;o}.join}}
```
**Ungolfed:**
```
-> w, h, n {
  (1..h).map {
    (1..w).map {
      o, $. = $.%n < 1 ? 1 : 0, $.+ = 1
      o
    }
  }
}
```
Usage:
```
->w,h,n{(1..h).map{(1..w).map{o,$.=$.%n<1?1:0,$.+=1;o}}}[8,6,7]
=> [[0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0]]
```
[Answer]
## MATLAB, 44 bytes
Note: Very different approach than the one used by Tom Carpenter.
```
@(x,y)char(reshape(~mod(1:prod(x),y),x)'+46)
```
Defines an anonymous function that accepts inputs as `[W,H],N`. I approached this problem using not-the-modulo-of-*N* for an array 1:W\*H and then simply reshaping the solution to a two-dimensional array, which is then converted to a character array. 
Example output for `[5,3],7`:
```
.....
./...
.../.
```
[Answer]
# Common Lisp, SBCL, 94 bytes
```
(lambda(a b c)(dotimes(i(* a b))(format t"~:[.~;X~]~@[~%~]"(=(mod(1+ i)c)0)(=(mod(1+ i)a)0))))
```
### Explanation
```
~:[.~;X~] <-- takes argument - if argument is true write ., if false write X
~@[~%~] <-- takes argument - if argument is true write newline, if not treat argument as if it was not used
```
`(=(mod(1+ i)c)0)(=(mod(1+ i)a)0)` looks pretty silly (because it's so similiar but I don't know if it can be solved, saving bytes
I use `(1+ i)` instead of `i` because `dotimes` starts from `i=0` and I want to start from `1`. It is also helpful because I can use `(* a b)` instead of `(1+(* a b))`
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-R`](https://codegolf.meta.stackexchange.com/a/14339/), 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Takes input as `[W,H],N` and uses spaces instead of `.`s & `"`s instead of `X`s.
```
√ó√ÆQ√πV)√≤U√é
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LVI&code=1%2b5R%2bVYp8lXO&footer=rrhxLiByUSdY&input=WzcgM10gMw)
[Answer]
# [Uiua](https://www.uiua.org), 17 bytes
```
‚ÜØ‚áå‚äü‚äô‚äô(‚áå‚äÇ@X‚ÜØ:@.-1)
```
[Test pad](https://uiua.org/pad?src=0_8_0__RiDihpAg4oav4oeM4oqf4oqZ4oqZKOKHjOKKgkBY4oavOkAuLTEpCgpGIDcgMyAzCkYgMTAgNCA1CkYgNSA1IDEKRiA1IDUgMgo=)
[Answer]
# [Perl 5](https://www.perl.org/) `-a`, 44 bytes
```
print$_%$F[1]&&1,$/x!($_%"@F")for 1.."@F"*<>
```
[Try it online!](https://tio.run/##K0gtyjH9/7@gKDOvRCVeVcUt2jBWTc1QR0W/QlEDKKDk4KakmZZfpGCopwdia9nY/f9vaKBgymXyL7@gJDM/r/i/rq@pnoGhwX/dRAA "Perl 5 ‚Äì Try It Online")
Input format is:
```
W N
H
```
Output uses `1` for the spacer and `0` for the character.
[Answer]
# Java, ~~185~~ 183 bytes
Thanks Thomas Kwa, for saving me 2 bytes!
```
interface B{static void main(String[] a){int w = Byte.parseByte(a[0]);for(int i=0;i++<w*Byte.parseByte(a[1]);)System.out.print((i%Byte.parseByte(a[2])>0?".":"X")+(i%w<1?"\n":""));}}
```
Ungolfed (ish):
```
interface A {
  static void main(String[] a) {
    int w = Byte.parseByte(a[0]);
    for(
      int i = 0;
      i++ < w*Byte.parseByte(a[1]);
    )
      System.out.print((
        i%Byte.parseByte(a[2]) > 0 ? "." : "X"
        )+(
        i%w < 1 ? "\n" : ""
      ));
  }
}
```
Usage:
```
$ java B 5 3 7
.....
.X...
...X.
```
Maybe java will win one day :P
]