SFML
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 123 |
|
|
| 28 Mar 2012 02:27 AM |
Here's what I have so far :/
{ string map[15][78]; map[1][1],map[2][1],map[3][1],map[4][1],map[5][1],map[6][1],map[7][1],map[8][1],map[9][1],map[10][1],map[11][1],map[12][1],map[13][1],map[14][1],map[15][1] = "#"; for (int n=0;n<78;n++) { map[1][n] = "#"; n++; } for (int a=0;a<15;a++) { cout << map[a][1]; a++; } for (int b=0;b<78;b++) { cout << map[15][b]; } }
Works, but stops responding. |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
| |
|
SFML
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 123 |
|
| |
|
ENET
|
  |
| Joined: 01 Jan 2010 |
| Total Posts: 4820 |
|
|
| 28 Mar 2012 06:55 AM |
| Why are you using a string? Use a char array... No offence, but I wouldn't use a datatype that requires an import when there is a perfectlly useable dataset already existant. |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 28 Mar 2012 07:02 AM |
| No. Just no. First of all, don't count it yourself, get the program to find the length. Second of all, use a character array, like he said. They are easy to use and work for pretty much everything. Thirdly, wtf are you trying to do? |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 28 Mar 2012 07:42 AM |
| Isn't there like, foreach? |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2012 09:12 AM |
| That looks like you want a grid of strings so you can mark what block is "AIR" and what is "STOEN" or something else laggy and inefficient :3 |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2012 09:52 AM |
| OH GOSH PLEASE LEARN TO PROGRAM |
|
|
| Report Abuse |
|
|
SFML
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 123 |
|
|
| 28 Mar 2012 01:15 PM |
I've changed it to a char array instead, the window doesn't freeze (thank god) BUT It just couts a bunch of random characters... D: |
|
|
| Report Abuse |
|
|