can any body convert this to switch statement
thankxxxx..
public char CheckDir(int row, int col, int selectedX, int selectedY)
{
if (row == selectedX)
{
if (col - selectedY == -2) { return 'd'; } //DOWNWARDS
else if (selectedY + 2 == col) { return 'u'; } //UPWARDS
}
else if (col == selectedY)
{
if (row - selectedX == -2) { return 'l'; } //LEFTBOUND
else if (selectedX + 2 == row) { return 'r'; } //RIGHTBOUND
}
i did this but its not working
public char CheckDir(int row, int col, int selectedX, int selectedY)
{
switch (dir)
{
case 'd': row == selectedX;
break;
case 'u': selectedY + 2 == col;
break;
case 'l': row - selectedX = 2;
break;
case 'r': selectedX + 2 == row;
break;
default: return 'o';
}