codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
int main(void) { int x, y; /* pixel x/y coords */ int w = 8, h = 10; /* pixel width/height*/ for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { printf(" (%2d ,%2d ) ", x, y); } printf("\n"); } puts("\nMapped to:\n"); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { printf("(%1.2f,%1.2f) ", (double) x / w, (double) y / h); } printf("\n"); } return 0; }
Private
[
?
]
Run code
Submit