root/06/libkombilo-branches/hash_center/test_hash_center.py

Revision 242, 418 bytes (checked in by ug, 1 year ago)

Hashing for center position works now. Further testing is required.
Processing is still too slow at the moment.

  • Property svn:executable set to *
Line 
1 #!/usr/bin/env python2.4
2 hashCode = -1874853872
3 result = []
4 # stone at position (x1, y1) at bits 4*x1+yy1 4*x1+y1+1
5 for x1 in range(4):
6     for y1 in range(4):
7         p = 2*(4*x1+y1);
8         hp = ((hashCode >> p)%4)
9         if hp == 0: result.append('.')
10         elif hp == 1: result.append('X')
11         elif hp == 2: result.append('O')
12         else: result.append('?')
13     result.append('\n')
14 print ''.join(result)
Note: See TracBrowser for help on using the browser.