format_page.c

final_realms_fluffos_v1/lib/secure/simul_efun/format_page.c · 385 B

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

string format_page(string *items, int columns) {
    int width, i, j, x;
    string ret;

    if(!columns) columns = 2;
    ret = "";
    width = 75/columns;
    for(i=0, x = sizeof(items); i<x; i+=columns) {
        for(j=0; j<columns; j++) {
            if(i+j >= x) break;
            ret += arrange_string(items[i+j], width);
        }
        ret += "\n";
    }
    return ret;
}

Site Stats

Snippets: 1791
Codebases: 571