~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to enjuewemela/logic_board.py

  • Committer: facundo at com
  • Date: 2012-11-05 12:14:34 UTC
  • mto: (92.1.15 trunk)
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: facundo@taniquetil.com.ar-20121105121434-8pdaoelvcu9tq5zp
CodeĀ aesthetics.

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
        return m1
310
310
 
311
311
    # five elements and linear: just in the middle
312
 
    if len_m == 5 and \
313
 
       len(set(x[0] for x in match)) == 1 or \
314
 
       len(set(x[1] for x in match)) == 1:
315
 
        return match[2]
 
312
    if len_m == 5:
 
313
        linear_x = len(set(p[0] for p in match)) == 1
 
314
        linear_y = len(set(p[1] for p in match)) == 1
 
315
        if linear_x or linear_y:
 
316
            return match[2]
316
317
 
317
318
    # 5, 6, or 7 elements, can't be linear
318
319
    if 5 <= len_m <= 7: