我有点笨学面食用日语多长时间能学会会

根据之前的博文,我把给同学做的三子棋小游戏的代码发出来,只是界面很丑很丑,AI算法很笨很笨,过几天我传到网盘上,提供大家下载娱乐 - symons - 博客园
1 background_image_filename = 'blackground.png'
2 black_mouse_image_filename = 'black.png'
3 white_mouse_image_filename = 'white.png'
4 restart_icon_filename='restart.png'
5 pingju_icon_filename='pingju.jpg'
6 win_icon_filename='win.jpg'
7 lose_icon_filename='lose.jpg'
9 import pygame
10 import time
11 import sys
13 from pygame.locals import *
14 from sys import exit
16 HIGHLIGHTCOLOR = (255,255,255)
18 def AI(pp):
#status is now white and black key in the board
#taozi = white
#computer = black
if pp[1][1]=='none':
for i in range(0,3):
for j in range(0,3):
if pp[i][j]=='none':
pp[i][j]='white'
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
if cnt & num:
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
if cnt & num:
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
if cnt & num:
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
while tx&=0 and tx&3 and ty&=0 and ty&3 and pp[tx][ty]=='white':
if cnt & num:
pp[i][j]='none'
return x*3+y
115 def main():
pygame.init()
screen = pygame.display.set_mode((800,500),0,32)
pygame.display.set_caption("you can never win!")
background = pygame.image.load(background_image_filename).convert()
mouse_cursor = pygame.image.load(white_mouse_image_filename).convert_alpha()
white_sign = pygame.image.load(white_mouse_image_filename).convert_alpha()
= pygame.image.load(restart_icon_filename).convert_alpha()
= pygame.image.load(pingju_icon_filename).convert_alpha()
= pygame.image.load(win_icon_filename).convert_alpha()
= pygame.image.load(lose_icon_filename).convert_alpha()
black_sign = pygame.image.load(black_mouse_image_filename).convert_alpha()
position=[ [27,11,93,68,0],[240,6,304,60,1],[476,4,525,42,2],[24,206,80,265,3],[246,212,292,257,4],[477,212,528,258,5],[26,440,73,479,6],[244,435,292,478,7],[475,435,527,480,8] ]
positionMid=[ [48-26,24-24],[269-26,24-24],[500-26,24-24],[48-26,233-24],[269-26,234-24],[500-26,234-24],[48-26,459-24],[269-26,460-24],[500-26,460-24] ]
positionColor=[ 'none','none','none','none','none','none','none','none','none']
whoIsTurn = ['computer','taozi']
# 1 means taozi
# 0 means computer
pp=[ ['none','none','none'],
['none','none','none'],['none','none','none']]
color = 'white'
color1 = 'black'
color2 = 'none'
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == MOUSEBUTTONDOWN :
newx,newy = pygame.mouse.get_pos()
for i in position:
if (newx&=i[0] and newx &= i[2]) and (newy &= i[1] and newy &= i[3]):
if positionColor[j]!='none':
positionColor[j]= color
#positionColor[j+1]= color
for ii in range(0,3):
for jj in range(0,3):
pp[ii][jj]=positionColor[ii*3+jj]
# AI begin
res = AI( pp )
positionColor[res]=color1
# AI finished
if newx&=674 and newx&=774 and newy&=396 and newy&= 496:
for i in range(0,3):
for j in range(0,3):
positionColor[i*3+j]='none'
pp[i][j]='none'
screen.blit(background,(0,0))
screen.blit(restart,(674,396))
#x,y = pygame.mouse.get_pos()
#x -= mouse_cursor.get_width()/2
#y -= mouse_cursor.get_height()/2
#if win==0:
screen.blit(mouse_cursor,(x,y))
#x,y = pygame.mouse.get_pos()
for i in position:
x,y = pygame.mouse.get_pos()
if (x&=i[0] and x &= i[2]) and (y &= i[1] and y &= i[3]):
if positionColor[ int(i[4]) ]=='none':
#pygame.draw.rect(screen,HIGHLIGHTCOLOR,(x,y,52,52),0)
screen.blit(mouse_cursor,(x,y))
print("done it")
print("color= ",positionColor[i[4]])
for ii in [0,1,2,3,4,5,6,7,8]:
if positionColor[ii] != 'none':
if positionColor[ii] == 'white':
#print("write white_sign")
screen.blit(white_sign,positionMid[ii] )
#print("write black_sign")
screen.blit(black_sign,positionMid[ii])
for i in range(0,3):
for j in range(0,3):
pp[i][j]=positionColor[i*3+j]
for i in range(0,3):
if pp[i][0]==pp[i][1] and pp[i][0]==pp[i][2] and pp[i][0]!='none':
winner=pp[i][0]
if pp[0][i]==pp[1][i] and pp[0][i]==pp[2][i] and pp[0][i]!='none':
winner=pp[0][i]
if pp[0][0]==pp[1][1] and pp[0][0]==pp[2][2] and pp[0][0]!='none':
winner=pp[0][0]
if pp[2][0]==pp[1][1] and pp[1][1] == pp[0][2] and pp[1][1]!='none':
winner=pp[1][1]
if win==0:
cntcolor=0
for i in range(0,3):
for j in range(0,3):
if pp[i][j]!='none':
cntcolor=cntcolor+1
if cntcolor==9 :
winner='pingju'
if win==1 :
#print("someone win!")
if winner=='white':
screen.blit(winicon,(50,20))
elif winner=='pingju':
screen.blit(pingju,(100,100))
screen.blit(lose,(100,100))
#print("winner = ",winner)
#time.sleep(10000)
pygame.display.update()
262 if __name__ == '__main__':我很笨很笨长得很难看有点自闭同学说我不合群经常做错事弄笑话不敢面对现实喜欢看小说不敢与人交流因为..._百度知道
我很笨很笨长得很难看有点自闭同学说我不合群经常做错事弄笑话不敢面对现实喜欢看小说不敢与人交流因为...
我很笨很笨长得很难看有点自闭同学说我不合群经常做错事弄笑话不敢面对现实喜欢看小说不敢与人交流因为怕说多错多可这样一来父母更讨厌我了,我很害怕别人的眼光,男生看到基本讥笑,想在现实中有个与我差不多的知己就我们两就好了不知道怎么办本人是女生已经十八岁了
但是 你 自己一直 闷声不吭 . 人嘛 都因为有了一个主要的 特点 才会有人注意 要么 学习 突出 要么 漂亮 要么有钱
其实这也正常 现在的同学 谁会和长得难看 而且老是做错事的同学一起玩呢
但是也不能说 每一个
我同学 同学当中也有一个 女生 长得也不好看 而且是算是内向的 但是人 却很 讲道理
而且 事实论事
虽说不好看但是我 真的 欣赏她
. 不过 我可以做个朋友 有什么 想不通的 我可以来 给你 解答看看
来自团队:
其他类似问题
为您推荐:
其他6条回答
多学点东西充实自己当别人说你时就让他们说吧,不要理会那些人的嘴脸自己做好了她们就不会一直说了还有,一定要自信相信自己很棒,然后证明给自己和别人看
善良和毅力才是女人的财富,生活不会亏待努力的人
多思考,多读书。阅读让女孩子更有魅力。
自信很重要。多出去走走,人活着必然要受到他人的目光,以自己最好的姿态出去。有些人喜欢看小说是有点逃避现实沉溺的意思。学点东西充实自我,让自己有一技之长,不要管别人的眼光,定下一个目标。
姐,从倒下从哪里爬起来,不要介意别人的眼光,人生么,走的时候总会有几头猪在笑,慢慢来,和别人相处,现实不可以就从先网络来,慢慢在到现实,一步步走,可以加我QQ一般会在
和我以前很像,不要因为未知而害怕,那样会变得无知,别人不是讥笑而是你自己太敏感多疑,现实不是为你存在的,你要学会理解与明白,学会改变自己去应对这个世界
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁我是一名初中生,明年上初二.感觉自己脑子很笨,但对哲学很感兴趣,想去读几本关于入门哲学的书.入门的.并且翻译的又很好.各个方面综合起来不错的.最好是自己亲身读过的,并且有亲身体会._百度作业帮
我是一名初中生,明年上初二.感觉自己脑子很笨,但对哲学很感兴趣,想去读几本关于入门哲学的书.入门的.并且翻译的又很好.各个方面综合起来不错的.最好是自己亲身读过的,并且有亲身体会.如有感激不尽!
卖萌自重00334
书单:西方:《苏菲的世界》 比较特殊的一本.不是学术性质的 作为入门读物看看不错《理想国》 柏拉图代表作《形而上学》 亚里士多德 哲学方面的开山著作《纯粹理性批判》 康德 《作为意志和表象的世界》 叔本华 (这两本读起来可能有点吃力)更近一点的就不推荐入门读了东方:诸子百家都先看一看吧.《中国哲学简史》 冯友兰 了解中国哲学的入门读物
其他类似问题
《哲学的故事》一个一个的小故事,很有趣又能了解哲学
一点粗浅建议~《哲学史教程》,文德尔班(德),商务印书馆。这本非常好,还便宜……能对哲学有个大体上的认识,但对于初学者有点晦涩。有不懂的词就去查一查,如果读下来的话会有很大收获。然后我觉得可以去读一些原著,按照哲学发展的脉络来选择一些特征比较明显的,比如古希腊哲学可以先读《理想国》,希腊化时代可以读西塞罗的,中世纪的读奥古斯丁的《论自由意志》,然后笛卡尔、黑格尔、康德休谟什么的...
扫描下载二维码}

我要回帖

更多关于 韩语多长时间能学会 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信