xilef
Member
- Joined
- Oct 31, 2009
- Messages
- 6
- Programming Experience
- 1-3
I have a block of text in a text .txt file that looks like this:
The entire block of text has 32 lines and 32 characters per line (32x32 grid)
I want to make an if statement that targets specific characters using an x variable and a y variable.
EG:
Can someone please help me?
I've tried reading every character and entering them into a 2D array (failed)
I've tried splitting them into individual lines and entering them into a 1D array (Success, but very difficult to target individual characters from this, and will take a long time to set up as I only did this for 10 lines)
EDIT: I'm using visual basic .net 2005 with .net framework 2.0
VB.NET:
....xxxxxxxxxxxxxxxxxxxxxxxxx...
....xxxxxxxxxxxxxxxxxxxxxxxxx...
...xxxxxxxxxxxxxxxxxxxxxxxxxx...
..xxxxxxxxxxxxxxxxxxxxxxxxxxx...
..xxxxxxxxxxxxxxxxxxxxxxxxxxxx..
...xxxxxxxxxxxxxxxxxxxxxxxxxx...
....xxxxxxxxxxxxxxxxxxxxxxxxxx..
.....xxxxxx..xxxxxxxxxxxxxxxxx..
......xxxxx...xxxxxxxxxxxxxxx...
I want to make an if statement that targets specific characters using an x variable and a y variable.
EG:
VB.NET:
If character(x,y) = "x"
then
msgbox("Oh dear, an x")
elseif character(x,y) = "."
msgbox("Success! A .!")
endif
I've tried reading every character and entering them into a 2D array (failed)
I've tried splitting them into individual lines and entering them into a 1D array (Success, but very difficult to target individual characters from this, and will take a long time to set up as I only did this for 10 lines)
EDIT: I'm using visual basic .net 2005 with .net framework 2.0