test


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

#! /usr/bin/env python
# -*- coding:utf-8 -*-
 
player = 1 
a = [range(8),range(8),range(8),range(8),range(8),range(8),range(8),range(8)]
for i in range(8):
        for j in range(8):
                a[i][j] = 0
a[3][3] = 1
a[3][4] = 2 
a[4][3] = 2 
a[4][4] = 1 
while True: 
        for i in range(8):
                for j in range(8):
                        if (a[i][j] == 0):
                                print "□ ",
                        elif (a[i][j] == 1):
                                print "× ",
                        else:
                                print "● ",
                print "\n"
        print "Player"+str(player)
        x = input("Please input x:")
        y = input("Please input y:")
        if ( x >= 0 and x < 8 and y >= 0 and y < 8):
                if(a[y][x] == 0): 
                        a[y][x] = player
                else:
                        print "既に石が置かれています。\n"
        else:
                print "不正な入力です。\n"
        if player == 1:
                player = 2
        else:
                player = 1