![]() |
![]() |
#1 |
中级会员
![]() ![]() ![]() ![]() ![]() ![]() ![]() 注册: 07年02月20日
帖子: 257
声望力: 21
声望:
10
![]() 现金:24两梁山币
资产:24两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
[抛砖引玉] 中文数字转换罗马数字机器人
其实也不是机器人拉,就一个trigger,用的上的朋友请下载,高手有空的话帮帮忙改改code找找bug吧.. bow 指令是: chat chanum "中文数字" 例子: chat chanum 九千九百九十九 ------下载此贴附件最少需要拥有1两梁山币,方有下载权限。------
|
![]() |
![]() |
![]() |
#2 |
中级会员
![]() ![]() ![]() ![]() ![]() ![]() ![]() 注册: 07年02月20日
帖子: 257
声望力: 21
声望:
10
![]() 现金:24两梁山币
资产:24两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
顺便说下,此机器不能转换“亿"
|
![]() |
![]() |
![]() |
#3 |
中级会员
![]() ![]() ![]() ![]() ![]() ![]() ![]() 注册: 07年02月20日
帖子: 257
声望力: 21
声望:
10
![]() 现金:24两梁山币
资产:24两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
压缩版 .
------下载此贴附件最少需要拥有1两梁山币,方有下载权限。------
|
![]() |
![]() |
![]() |
#4 |
中级会员
![]() ![]() ![]() ![]() ![]() ![]() ![]() 注册: 07年02月20日
帖子: 257
声望力: 21
声望:
10
![]() 现金:24两梁山币
资产:24两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
checkNum = 0 correctNum = 1 tmp = %2 chatName = %1 showNum = @tmp #math tmpCount {%len( @tmp) / 2} tmpLen = %len( @tmp) #loop 1,@tmpCount { #math tmpLen {@tmpLen - 2} tmpNum = %db( @convertChineseNum, %left( @tmp, 2)) #addkey tmpNumList {%i} {@tmpNum} @tmp = %rightback( @tmp, @tmpLen) } #loopdb @tmpNumList { #if %val>99 { #math lastPos {%key - 1} #math nextPos {%key + 1} lastNum = %db( @tmpNumList, @lastPos) nextNum = %db( @tmpNumList, @nextPos) #if %val=10000 { #math lastTwoPos {%key - 2} lastTwoNum = %db( @tmpNumList, @lastTwoPos) #if @lastNum!=10 {#math checkNum {@checkNum * %val}} #unvar lastTwoPos #unvar lastTwoNum } {#math checkNum {@checkNum + @lastNum*%val}} #if @nextNum>9 {#if @nextNum!=10000 {correctNum = 0}} #unvar lastPos #unvar nextPos #unvar lastNum #unvar nextNum } #if %val=0 { #math nextPos {%key + 1} nextNum = %db( @tmpNumList, @nextPos) #math nextTwoPos {%key + 2} nextTwoNum = %db( @tmpNumList, @nextTwoPos) #if @nextTwoNum<10 {#math checkNum {@checkNum + @nextNum}} #if @nextTwoNum=10000 {#math checkNum {@checkNum + @nextNum}} #if @nextNum>9 {correctNum = 0} #unvar nextPos #unvar nextNum #unvar nextTwoPos #unvar nextTwoNum } #if %val=10 { #math lastPos {%key - 1} #math nextPos {%key + 1} lastNum = %db( @tmpNumList, @lastPos) nextNum = %db( @tmpNumList, @nextPos) #if !@lastNum {#if @nextNum!=10000 {#math checkNum {@checkNum + %val + @nextNum}} {#math checkNum {%val * @nextNum}}} {#if @nextNum!=10000 {#math checkNum {@checkNum + @lastNum*%val + @nextNum}} {#math checkNum {(@checkNum + @lastNum*%val) * @nextNum}}} #if @nextNum>9 {#if @nextNum!=10000 {correctNum = 0}} #unvar lastPos #unvar nextPos #unvar lastNum #unvar nextNum } #if %key=@tmpCount { #if %val<10 { #math lastPos {%key - 1} lastNum = %db( @tmpNumList, @lastPos) #if @lastNum<10 {#if @lastNum>0 {correctNum = 0}} #unvar lastPos #unvar lastNum } } #if @tmpCount=1 {checkNum = %db( @tmpNumList, %key)} } #if @correctNum=0 {chat %1, 数字错误:@showNum} {chat %1, 数字为: @checkNum} #unvar tmpNumList #unvar checkNum #unvar correctNum #unvar tmp #unvar chatName #unvar showNum #unvar tmpLen #unvar tmpCount #unvar tmpNum |
![]() |
![]() |
![]() |
#5 |
高级会员
![]() ![]() ![]() ![]() ![]() ![]() 注册: 09年05月20日
帖子: 194
声望力: 18
声望:
32
![]() 现金:456两梁山币
资产:456两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
这个用在什么地方tenten
|
![]() |
![]() |
![]() |
#6 |
初级会员
![]() ![]() ![]() ![]() 注册: 09年07月11日
帖子: 38
声望力: 0
声望:
10
![]() 现金:82两梁山币
资产:82两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
这个。。。技术活太多,实用性不强啊。。。
|
![]() |
![]() |
![]() |
#7 |
中级会员
![]() ![]() ![]() 注册: 07年03月08日
帖子: 55
声望力: 19
声望:
31
![]() 积分:1
精华:1
现金:71两梁山币
资产:71两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: [抛砖引玉] 中文数字转换罗马数字机器人
|
![]() |
![]() |