Hi all,
I am trying to implement a strategy game that lets the user define the strategy. I would like to be able to convert their strategy as a string into VB.NET code that can be used in the application. Is this feasible in VB.NET?
Example
Blue Team's user code:
If square_to_the_left is empty then attack square_to_the_left
VB.NET:
map is the textbox with the text maps out the units/positions.
dim start_position as integer = map.indexof("BlueUnit")
if map.substring(start_position - 8, 8) <> "RedUnit_" then
map.substring(start_position - 8, 8) = "BlueUnit"
end if
This is not the actual code, but it is something along those lines. The main problem is converting the user's input into VB code and used to run the program.
Thanks in advance.
I am trying to implement a strategy game that lets the user define the strategy. I would like to be able to convert their strategy as a string into VB.NET code that can be used in the application. Is this feasible in VB.NET?
Example
Blue Team's user code:
If square_to_the_left is empty then attack square_to_the_left
VB.NET:
map is the textbox with the text maps out the units/positions.
dim start_position as integer = map.indexof("BlueUnit")
if map.substring(start_position - 8, 8) <> "RedUnit_" then
map.substring(start_position - 8, 8) = "BlueUnit"
end if
This is not the actual code, but it is something along those lines. The main problem is converting the user's input into VB code and used to run the program.
Thanks in advance.