All pastes #778472 Raw Edit

Something

public cpp v1 · immutable
·published 2007-11-17 16:37 UTC
rendered paste body
#include <stdio.h>#include <iostream>using namespace std;class Cmap{	char m[10][10];	public:	char get (int x=0, int y=0){		return((((x<0)||(x>9))||((y<0)||(y>9)))?'X':m[x][y]);	}	Cmap(int i=0){		for(int o=0;o<10;o++)			for(int u=0;u<10;u++)				m[o][u]='.';	};		ostream& trk(ostream& os, int b=0){		for(int o=0-b;o<10+b;o++){			for(int u=0-b;u<10+b;u++)				os << get(o,u);			os << endl;		}		return os;	}};typedef class Cmap Cmap;ostream& operator << (ostream& os, Cmap& m){	for(int o=0;o<10;o++){		for(int u=0;u<10;u++)				os << m.get(o,u);		os << endl;	}	return os;}int main (void){	FILE *sf,*vf;	sf=fopen("laev.sis","r");	vf=fopen("laev.val","w");	int i, j;	Cmap a;	a.trk(cout,1);	cout << a;		fclose(sf);	fclose(vf);}