Code For A Algorithm In Games