solved player possible actions algorithm