飞扬围棋

标题: 有大佬搞一个飞扬版发阳论吗? [打印本页]

作者: 欧拉    时间: 2020-6-6 16:44
标题: 有大佬搞一个飞扬版发阳论吗?
最近找出来大本头的《发阳论研究》翻看,打算提高一下,但总觉得字图都偏小,看一会儿眼睛就累了,也许是我近视加老花的缘故,不知道大家是否有这样的感受?如果群里大佬搞一个飞扬版发阳论,排版和字都放大点,估计会有销路的吧

作者: 傻瓜    时间: 2020-6-6 17:13
淑贞自己搞
搞完成大佬

作者: choufengzi    时间: 2020-6-6 17:29
欧拉
作者: 欧拉    时间: 2020-6-6 17:30
傻瓜 发表于 2020-6-6 17:13
淑贞自己搞
搞完成大佬

当大佬太累,还是当小弟省心

作者: 肥虎    时间: 2020-6-6 17:40
从来就没有什么救世主,一切只能自己靠自己。
作者: 欧拉    时间: 2020-6-6 17:54
15年前倒是自己用 python 2.  写过一个程序,能把 sgf 文件的问题图 转换成 txt 文本,源代码分享给大家,
现在 用 python 3. 了,有些地方要改一下才能运行了。

import dircache
from os import *

m = map(None, 'abcdefghijklmnopqrs', range(1,20))
m2 = map(None, 'srqponmlkjihgfedcba', range(1,20))

EMPTY_ROW=2
EMPTY_COL=3

def convert(sgfGame,txtGame,prb):
        # x="ab" pos0=1,pos1=2
        moveList=[]
        # black or white stone list
        i=0
        whoMove='B'
        while (i<len(sgfGame)):
                while not (sgfGame[i]=='A' and ( sgfGame[i+1]=='B' or sgfGame[i+1]=='W') ):
                        i=i+1
                        if i >len(sgfGame)-2:
                                break
                if i >= len(sgfGame)-2:
                        break
                color=sgfGame[i+1]       
                i=i+2
                while(  i<len(sgfGame)-3 and sgfGame[i]=='[' and sgfGame[i+3]==']' ):
                        moveList.append(sgfGame[i+1:i+3]+color)
                        i=i+4
                        if sgfGame[i]=='\x0d':
                                i=i+2
                if i >= len(sgfGame)-3:
                        break              
        i=0
        while (i<len(sgfGame)-3 and sgfGame[i:i+2]<>';B' and sgfGame[i:i+2]<>';W' ):
                i=i+1
        if sgfGame[i+1]=='B':
                whoMove='B'
        elif sgfGame[i+1]=='W':
                whoMove='W'
        else:
                print('error'+sgfGame[i+1]+':'+prb)
        i=0
        while (i<len(sgfGame)-3 and sgfGame[i:i+2]<>'AE' ):
                i=i+1
        if sgfGame[i:i+2]=='AE':
                print ('error  AE AE AE _______:'+prb)
        emptyRow=1
        emptyCol=1
        mset='none'
        pos0_sum=0
        pos1_sum=0
        pos_count=0
        for x in moveList:               
                pos0 = filter(lambda z, x=x: z[0]==x[0], m)[0][1]
                pos1 = filter(lambda z, x=x: z[0]==x[1], m)[0][1]
                pos0_sum=pos0_sum+pos0
                pos1_sum=pos1_sum+pos1
                pos_count=pos_count+1
        pos0_avg=pos0_sum/pos_count
        pos1_avg=pos1_sum/pos_count
        if pos1_avg<10:
                if pos0_avg<10:
                        mset='tl'
                else:
                        mset='tr'       
        else:
                if pos0_avg<10:
                        mset='dl'
                else:
                        mset='dr'       
               if mset=='dr':
                pos1_avg=20-pos1_avg
                       pos0_avg=20-pos0_avg
        if mset=='dl':
                       pos1_avg=20-pos1_avg
        if mset=='tr':
                       pos0_avg=20-pos0_avg
        for x in moveList:               
                pos0 = filter(lambda z, x=x: z[0]==x[0], m)[0][1]
                pos1 = filter(lambda z, x=x: z[0]==x[1], m)[0][1]
                if mset=='dr':
                        pos1=20-pos1
                        pos0=20-pos0
                if mset=='dl':
                        pos1=20-pos1
                if mset=='tr':
                        pos0=20-pos0
                if pos0_avg<pos1_avg:
                        posp=pos0
                        pos0=pos1
                        pos1=posp
                if pos1>emptyRow:
                        emptyRow=pos1
                if pos0>emptyCol:
                        emptyCol=pos0
                pos=((pos1-1)*20+pos0-1)*2
                if (x[2] == 'B' and whoMove =='B') or (x[2] == 'W' and whoMove =='W'):
                        stone='\xa1\xf1'
                elif (x[2] == 'B' and whoMove =='W') or (x[2] == 'W' and whoMove =='B'):
                        stone='\xa1\xf0'
                else:
                        print 'error!!!!!'                               
                t=txtGame[0:pos]+stone+txtGame[pos+2:]
                txtGame=t
        return (txtGame,emptyRow,emptyCol)
        
dir=dircache.listdir('tlt/')
emptyGame=file("board.txt","rb")
emptyBoard=emptyGame.read()
txtFile=file("tlt.txt","w+b")
for x in dir:
        txtGame=emptyBoard
        string_x=str(x)       
        sgfFile=file("tlt/"+str(x),"rb")
        sgfGame=sgfFile.read()
        #txtGame=convert(sgfGame,txtGame)       
        (txtGame,emptyRow,emptyCol)=convert(sgfGame,txtGame,x)       
        endRow=9
        emptyCol=14       
        for i_row in range(0,endRow):
                end=emptyCol*2               
                # txtFile.write(txtGame[i_row*40:i_row*40+end])
                if i_row==endRow-1:
                        txtFile.write(txtGame[i_row*40:i_row*40+end-4]+string_x[1:5])
                else:
                        txtFile.write(txtGame[i_row*40:i_row*40+end])                       
                txtFile.write('\x20\x0d\x0a')
        txtFile.write('\x0d\x0a')
               
        sgfFile.close()

txtFile.close()

作者: libai888    时间: 2020-6-6 18:05
厉害
作者: czh300    时间: 2020-6-6 19:14
头像暴露年龄!
作者: 傻瓜    时间: 2020-6-6 19:33
新人帖!

作者: libai888    时间: 2020-6-6 19:57
话说淑贞当年实在是令人食欲大增。
作者: libai888    时间: 2020-6-6 19:58
等待吴诗人搞个傻瓜版发扬论,不然坚决远离。
作者: 阿扬    时间: 2020-6-6 21:23
发扬轮工程太巨大了
作者: 十月雨丝    时间: 2020-6-6 21:53
高手。
作者: 熠熠生辉    时间: 2020-6-6 22:11
论实用性前田陈尔系列更好些
作者: 熠熠生辉    时间: 2020-6-6 22:14
记得有职业说发阳论做过几遍,就看想不想出书,可万一有漏。面子上下不来
作者: hahei09    时间: 2020-6-6 22:41
淑贞妹妹,买个趁手的老花镜或放大镜不是更好吗?
作者: 欧拉    时间: 2020-6-6 22:49
主要是心理上觉得看小字不爽,放大镜和老花镜都还不需要
作者: 鲸头散_dQFJj    时间: 2020-6-6 23:19
程晓流精装版不错
作者: chenggs2008    时间: 2020-6-7 16:56
还是知难而退,保全名声吧
作者: 逢芳必点    时间: 2020-6-7 19:08
欧拉  好名字
作者: 十月雨丝    时间: 2020-6-8 13:37
逢芳必点 发表于 2020-6-7 19:08
欧拉  好名字

但还是不如“淑贞”好

作者: 榉木    时间: 2020-6-8 15:05
淑贞,注意保护视力,劳逸结合
作者: 榉木    时间: 2020-6-8 15:06
choufengzi 发表于 2020-6-6 17:29
欧拉

欧拉不是电动汽车吗

作者: leexch    时间: 2020-6-8 15:30
现在不管谁出发阳论,一定会发现还有BUG
作者: 傻瓜    时间: 2020-6-8 15:35
本帖最后由 傻瓜 于 2020-6-8 15:36 编辑

淑贞新人帖一出,我等油腻老男人兴奋得胡言乱语
作者: 欧拉    时间: 2020-6-8 16:55
本帖最后由 欧拉 于 2020-6-8 17:32 编辑

请各位大哥多提携
作者: 傻瓜    时间: 2020-6-8 17:26
淑贞无情,这个寡淡的季节,让肥皂泡多飞一会儿多好
作者: 欧拉    时间: 2020-6-8 17:31
傻瓜 发表于 2020-6-8 17:26
淑贞无情,这个寡淡的季节,让肥皂泡多飞一会儿多好

好,那我改一下,再装一会儿

作者: SOARDLIANG    时间: 2021-10-2 09:26
肥虎说的对啊
从来就没有什么救世主,一切只能自己靠自己。
作者: 朱涵清    时间: 2022-1-5 16:17
15年前倒是自己用 python 2.  写过一个程序,能把 sgf 文件的问题图 转换成 txt 文本,源代码分享给大家,
现在 用 python 3. 了,有些地方要改一下才能运行了。

import dircache
from os import *

m = map(None, 'abcdefghijklmnopqrs', range(1,20))
m2 = map(None, 'srqponmlkjihgfedcba', range(1,20))

EMPTY_ROW=2
EMPTY_COL=3

def convert(sgfGame,txtGame,prb):
        # x="ab" pos0=1,pos1=2
        moveList=[]
        # black or white stone list
        i=0
        whoMove='B'
        while (i<len(sgfGame)):
                while not (sgfGame[i]=='A' and ( sgfGame[i+1]=='B' or sgfGame[i+1]=='W') ):
                        i=i+1
                        if i >len(sgfGame)-2:
                                break
                if i >= len(sgfGame)-2:
                        break
                color=sgfGame[i+1]      
                i=i+2
                while(  i<len(sgfGame)-3 and sgfGame[i]=='[' and sgfGame[i+3]==']' ):
                        moveList.append(sgfGame[i+1:i+3]+color)
                        i=i+4
                        if sgfGame[i]=='\x0d':
                                i=i+2
                if i >= len(sgfGame)-3:
                        break              
        i=0
        while (i<len(sgfGame)-3 and sgfGame[i:i+2]<>';B' and sgfGame[i:i+2]<>';W' ):
                i=i+1
        if sgfGame[i+1]=='B':
                whoMove='B'
        elif sgfGame[i+1]=='W':
                whoMove='W'
        else:
                print('error'+sgfGame[i+1]+':'+prb)
        i=0
        while (i<len(sgfGame)-3 and sgfGame[i:i+2]<>'AE' ):
                i=i+1
        if sgfGame[i:i+2]=='AE':
                print ('error  AE AE AE _______:'+prb)
        emptyRow=1
        emptyCol=1
        mset='none'
        pos0_sum=0
        pos1_sum=0
        pos_count=0
        for x in moveList:               
                pos0 = filter(lambda z, x=x: z[0]==x[0], m)[0][1]
                pos1 = filter(lambda z, x=x: z[0]==x[1], m)[0][1]
                pos0_sum=pos0_sum+pos0
                pos1_sum=pos1_sum+pos1
                pos_count=pos_count+1
        pos0_avg=pos0_sum/pos_count
        pos1_avg=pos1_sum/pos_count
        if pos1_avg<10:
                if pos0_avg<10:
                        mset='tl'
                else:
                        mset='tr'      
        else:
                if pos0_avg<10:
                        mset='dl'
                else:
                        mset='dr'      
               if mset=='dr':
                pos1_avg=20-pos1_avg
                       pos0_avg=20-pos0_avg
        if mset=='dl':
                       pos1_avg=20-pos1_avg
        if mset=='tr':
                       pos0_avg=20-pos0_avg
        for x in moveList:               
                pos0 = filter(lambda z, x=x: z[0]==x[0], m)[0][1]
                pos1 = filter(lambda z, x=x: z[0]==x[1], m)[0][1]
                if mset=='dr':
                        pos1=20-pos1
                        pos0=20-pos0
                if mset=='dl':
                        pos1=20-pos1
                if mset=='tr':
                        pos0=20-pos0
                if pos0_avg<pos1_avg:
                        posp=pos0
                        pos0=pos1
                        pos1=posp
                if pos1>emptyRow:
                        emptyRow=pos1
                if pos0>emptyCol:
                        emptyCol=pos0
                pos=((pos1-1)*20+pos0-1)*2
                if (x[2] == 'B' and whoMove =='B') or (x[2] == 'W' and whoMove =='W'):
                        stone='\xa1\xf1'
                elif (x[2] == 'B' and whoMove =='W') or (x[2] == 'W' and whoMove =='B'):
                        stone='\xa1\xf0'
                else:
                        print 'error!!!!!'                              
                t=txtGame[0:pos]+stone+txtGame[pos+2:]
                txtGame=t
        return (txtGame,emptyRow,emptyCol)
        
dir=dircache.listdir('tlt/')
emptyGame=file("board.txt","rb")
emptyBoard=emptyGame.read()
txtFile=file("tlt.txt","w+b")
for x in dir:
        txtGame=emptyBoard
        string_x=str(x)      
        sgfFile=file("tlt/"+str(x),"rb")
        sgfGame=sgfFile.read()
        #txtGame=convert(sgfGame,txtGame)      
        (txtGame,emptyRow,emptyCol)=convert(sgfGame,txtGame,x)      
        endRow=9
        emptyCol=14      
        for i_row in range(0,endRow):
                end=emptyCol*2               
                # txtFile.write(txtGame[i_row*40:i_row*40+end])
                if i_row==endRow-1:
                        txtFile.write(txtGame[i_row*40:i_row*40+end-4]+string_x[1:5])
                else:
                        txtFile.write(txtGame[i_row*40:i_row*40+end])                       
                txtFile.write('\x20\x0d\x0a')
        txtFile.write('\x0d\x0a')
               
        sgfFile.close()

txtFile.close()
哈哈
作者: 海中金    时间: 2022-1-9 18:43
淑贞自己搞
油腻男围观




欢迎光临 飞扬围棋 (http://flygo.net/bbs/) Powered by Discuz! X3.2