Welcome to Gaia! ::

        okay, so i need some python help, since i'm a total noob at that area.
        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:
            z.append(i-1)


        def kwadraat(x):
            return x*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
Threads can take 8 hours to fall off the first page here... and it's 1-3 AM in the US, where gaia is located.

Have patience.
        oh i'm sorry
        mr srs
Well, if you're going to mock me I'll just report your posts next time so a mod will be the one telling you not to bump, instead of me. heart

Quick Reply

Submit
Manage Your Items
Other Stuff
Get Items
Get Gaia Cash
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff