[ create a new paste ] login | about

Link: http://codepad.org/fmdj2iXR    [ raw code | fork ]

C, pasted on Sep 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* map.h */
#define MAP_H
void display(const int *p, int width, int height);

/* display.c */
#include <stdio.h>

static const char *symbols = " #???@";

void display(const int *p, int width, int height)
{
	int w, h;

	for (h = 0; h < height; h++) {
		for (w = 0; w < width; w++)
			putchar(symbols[p[h * width + w]]);
		putchar('\n');
	}
}


Create a new paste based on this one


Comments: