What changes do I need to make to my algorithm to make this scene from a different angle? The code below is in F#. It creates a scene which looks like a perspective coming from the top left. I thought if I would change i % j = w then it would come from the top right instead, but that doesn't work. So what change do I need to make for it to be able to come from the top right, bottom left, bottom right and even the top centre?

open System

let w = Console.WindowWidth
let h = Console.WindowHeight

for i in 1 .. w - 1 do
    for j in 1 .. h - 1 do
        Console.SetCursorPosition(i, j)
        if i % j = 0 then printf "."

Console.Read() |&gt; ignore


Here is what the program looks like.

 .......................................................................................................................  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
   .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .
     .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .
      .     .     .     .     .     .     .     .     .     .     .     .     .     .     .     .     .     .     .
       .      .      .      .      .      .      .      .      .      .      .      .      .      .      .      .      .        .       .       .       .       .       .       .       .       .       .       .       .       .       .
         .        .        .        .        .        .        .        .        .        .        .        .        .
          .         .         .         .         .         .         .         .         .         .         .
           .          .          .          .          .          .          .          .          .          .
            .           .           .           .           .           .           .           .           .
             .            .            .            .            .            .            .            .            .
              .             .             .             .             .             .             .             .
               .              .              .              .              .              .              .
                .               .               .               .               .               .               .
                 .                .                .                .                .                .                .                  .                 .                 .                 .                 .                 .
                   .                  .                  .                  .                  .                  .
                    .                   .                   .                   .                   .
                     .                    .                    .                    .                    .
                      .                     .                     .                     .                     .
                       .                      .                      .                      .                      .
                        .                       .                       .                       .
                         .                        .                        .                        .
                          .                         .                         .                         .
                           .                          .                          .                          .
                            .                           .                           .                           .
                             .                            .                            .                            .
Can you try replacing the original condition i % j == 0 with the following conditions? They work for me.


For a perspective coming from the top right, (w-i) %j == 0  
For a perspective coming from the bottom left, i %(h-j) == 0  
For a perspective coming from the bottom right, (w-i) % (h-j) == 0  
For a perspective coming from the the top centre, (w/2-i) % j == 0