
(actually that's the wrong resolution for those tiles, but that's beside the point)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ofstream newfile;
newfile.open ("mapfile3.txt", ios::out | ios::app);
ifstream themap ("simap.txt");
string line;
if (themap.is_open())
{
while (! themap.eof() )
{
getline (themap,line);
int linesize;
linesize = line.size();
for (int i=0;i<linesize;i++)
{
int value = ((int)line[i] - 48);
if(value > -1)
newfile << value << " ";
}
newfile << endl;
}
themap.close();
}
newfile.close();
char l;
cin >> l;
return 0;
}


Users browsing this forum: No registered users and 1 guest