A Algorithm Example Code In Python For Games