Quick actions

cmd+k|ctrl+k

Navigation

Languages

Ferz

Snippet info

Language

Csharp

Visibility

public

Author

paulkotov

Created

2017-05-16T18:18:33Z

Updated

2017-05-22T05:11:09Z

using System;

class MainClass {
    public static bool IsCorrectMove(string fr, string dist)
    {
        int yDiff = Math.Abs(dist[0] - fr[0]);
		int xDiff = Math.Abs((int)Char.GetNumericValue(dist[1]) - (int)Char.GetNumericValue(fr[1]));
	    if (fr!=dist)
	    { 
			if (xDiff == yDiff){ return true; }
			if ((xDiff != 0) && (yDiff == 0)){ return true;}
			if ((xDiff == 0) && (yDiff !=0)){ return true; }
			//if (fr == dist){ return false; }
	    }   	
			return false;
    }

    static void Main() {
        Console.WriteLine("Hello World!");
    }
}
INFO