Magical Panda
Offline
Post: 55906357_1 created on Wed Nov 04, 2009 7:37 amPosted: Wed Nov 04, 2009 7:37 am
![]() |
i have to write a program for the following game: OOXXOX XOXOOO XOOOXX XOOXOX OOXXOX XOOXXX the game is about people putting stones on a board one by one. if one player has more then one stones next to each other, it gives them points. one line of "n" stones next to each other will give you (n-1)^2 points. now i have to make a program which will count the points from all the horizontal lines. i have this already: Quote: y=[1,2,3,4] z=[] for i in y:
def kwadraat(x):
so this is the part where it does (n-1)^2. but i just get stuck at the point where i have to split the array into separate X's and O's, and how it can count how many of them are next to each other. help me? :c |
|





