#include <unistd.h>

void my_putchar(char c)
{
    write(1, &c, 1);
}

static void print_char(int x, int y, int i, int j)
{
    if (i == 0 || i == y - 1) {
        if (j == 0 || j == x - 1)
            my_putchar('o');
        else
            my_putchar('-');
    } else if (j == 0 || j == x - 1) {
        my_putchar('|');
    } else {
        my_putchar(' ');
    }
}

void rush(int x, int y)
{
    int i = 0;
    int j = 0;

    for (i = 0; i < y; i++) {
        for (j = 0; j < x; j++)
            print_char(x, y, i, j);
        my_putchar('\n');
    }
}

int main()
{
    rush(5, 5);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: