I'll search for the map function. Strange I've never seen it if it's so common... :/
Ok, I found it. It's STL, which I haven't much worked with, explaining why I haven't seen it.
I am, probably to Elysia's disproval, going to go with the map function, as it seems to be exactly what I am looking for. I'll post results later.