拳皇出招 转换为 宏

content = '''
*地狱极乐落:(近身)→↘↓↙←→↘↓↙←+A或C
*岚之山:(近身)←↙↓↘→←↙↓↘→+B或D
》续?切株返:岚之山中←↙↓↘→+B或D
》根拔里投:续?切株返中→↓↘+B或D
**》续?天地返:续?切株返中→↓↘+B或D
'''

'b,db,d,df,f,b,db,d,df,f2,b,db,d,df,f2,f,d,df2,f,d,df2'

replace_dict = {
    '←': 'b',
    '↙': 'db',
    '↓': 'd',
    '↘': 'df',
    '→': 'f',
    'A': '1',
    'B': '2',
    'C': '3',
    'D': '4',
    '+': '',
}

line = '→↓↘'

def replace_(x):
    value = replace_dict.get(x)
    if value:
        return value
    else:
        return x

line = ','.join([replace_(x) for x in line])
print(line)

你可能感兴趣的:(Linux,笔记,python,python,数据库,机器学习)