Welcome to Gaia! :: anyone knows python? i need some help | Forum

Register FaceBook Login Login

 

 
GST

Welcome to Gaia's forums, where millions of members gather to discuss random stuff, make new friends,
complain about life, argue about nothing, laugh at dumb pictures, discuss serious issues and/or curse like sailors.

Lurking is creepy. Quit skulking in the shadows and join the conversation!

Register to reply

Advertisement
Tags: anyone  knows  python 
Share:  
forum:43, topic:55906357
        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
 
     
 
        gonk
     
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
     
mirte @ DA
YOYOYO i need a new sig.
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

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

We will be phasing out support for your browser soon.

Please upgrade to one of these more modern browsers.