Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with cross
#18
def nextpos(doska, x, y):
	size = len(doska)
	if x < size // 2:
		if y > 0 and doska[y-1][x] == '*':
			return x, y-1
	else:
		if y < size-1 and doska[y+1][x] == '*':
			return x, y+1
	if y < size // 2:
		if x < size-1 and doska[y][x+1] == '*':            
			return x+1, y
	else:
		if x > 0 and doska[y][x-1] == '*':
			return x-1, y
	return x, y
I did it like this , but this function moves with figures counter-clockwise. I tried to make it in clock direction Big Grin Big Grin Big Grin Thanks for your recent help with spliting functions it helps me really. Cool


Messages In This Thread
help with cross - by Item97 - Nov-15-2017, 09:38 PM
RE: help with cross - by heiner55 - Nov-16-2017, 06:26 AM
RE: help with cross - by Item97 - Nov-16-2017, 07:02 AM
RE: help with cross - by heiner55 - Nov-16-2017, 07:23 AM
RE: help with cross - by Item97 - Nov-16-2017, 07:32 AM
RE: help with cross - by heiner55 - Nov-16-2017, 02:15 PM
RE: help with cross - by Item97 - Nov-18-2017, 05:01 PM
RE: help with cross - by heiner55 - Nov-18-2017, 05:31 PM
RE: help with cross - by Item97 - Nov-18-2017, 05:35 PM
RE: help with cross - by heiner55 - Nov-18-2017, 05:42 PM
RE: help with cross - by Item97 - Nov-18-2017, 05:55 PM
RE: help with cross - by heiner55 - Nov-18-2017, 06:04 PM
RE: help with cross - by Item97 - Nov-18-2017, 06:08 PM
RE: help with cross - by heiner55 - Nov-18-2017, 06:50 PM
RE: help with cross - by Item97 - Nov-22-2017, 07:14 PM
RE: help with cross - by heiner55 - Nov-23-2017, 07:18 AM
RE: help with cross - by Item97 - Nov-24-2017, 02:13 PM
RE: help with cross - by Item97 - Nov-24-2017, 03:17 PM
RE: help with cross - by Item97 - Nov-25-2017, 02:44 PM
RE: help with cross - by heiner55 - Nov-25-2017, 03:10 PM
RE: help with cross - by Item97 - Nov-25-2017, 07:33 PM
RE: help with cross - by heiner55 - Nov-25-2017, 07:38 PM
RE: help with cross - by Item97 - Nov-25-2017, 10:35 PM
RE: help with cross - by heiner55 - Nov-26-2017, 04:26 AM
RE: help with cross - by Item97 - Nov-26-2017, 09:06 AM
RE: help with cross - by heiner55 - Nov-26-2017, 09:17 AM
RE: help with cross - by Item97 - Nov-27-2017, 04:28 PM
RE: help with cross - by Item97 - Nov-28-2017, 09:18 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020