Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How to do this in Sepples?

Name: Anonymous 2011-08-14 12:58

iHaskal:
Data.Ix> range ((0,0), (3,4))
[(0,0),(0,1),(0,2),(0,3),(0,4),(1,0),(1,1),(1,2),(1,3),(1,4),(2,0),(2,1),(2,2),(2,3),(2,4),(3,0),(3,1),(3,2),(3,3),(3,4)]

Name: Anonymous 2011-08-15 0:17

idjits

#include <string>

std::string A(int x1, int y1, int x2, int y2)
{
    std::string res = "[";
    char asdf[100];

    for (int x = x1; x <= x2; x++) for (int y = y1; y <= y2; y++) {
        sprintf(asdf, "(%d, %d),", x, y);
        res += asdf;
    }

    return res.substr(0, res.size()-1)+"]";
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List