cnCalc计算器论坛

 找回密码
 注册
搜索
查看: 4210|回复: 2

[fx-9860/9750系列] 发一个24点的程序

[复制链接]
发表于 2010-8-6 08:42:25 | 显示全部楼层 |阅读模式
计算器程序
程序名称: 计算24点程序
平台: fx-9860GII fx-9860G & Slim fx-9750GII  
系统/软件要求:
版本号: 2.0.20100601
类型: 游戏 数学 
作者: kexuestudy
大小(K): 4
更新日期: 2010-06-01
描述: 24点程序(可在代码中修改点数——如36点~)
(1)输入4个数
(2)随机生成4个数
已知缺陷:
源代码: 开源/部分开源
无聊中解闷帮手
发现Bug请通知
还有,因为在Locate中显示时为了表达式美观,只给数字留了2个位,所以输三位数会有问题—
Filename:M-POINT
'Point M#E699?
24鉓?
'#E692Def 24?
"----   Point-------"?
Locate 5,1,M?
"#E69B(1)Enter 4 numbers?
#E69B(2)Ran 4 numbers"?鉟?
Y=2譍oto 4?
Lbl 0?
1鉙?
M鉔?
"A"?鉇:"B"?鉈:"C"?鉉:"D"?鉊?
A鉋:B鉌:C鉍:D鉎?
1鉙?
0鉏~L?
00鉖?
0鉠?
If Abs (ABCD)<M?
Then 3鉠?
Goto 2?
IfEnd?
Lbl 1?
0鉚?
((A+B)+C)+D=N?鉚?
((A+B)+C)-D=N?鉚?
((A+B)+C)繢=N?鉚?
((A+B)+C)罝=N?鉚?
((A+B)-C)+D=N?鉚?
((A+B)-C)-D=N?鉚?
((A+B)-C)繢=N?鉚?
((A+B)-C)罝=N?鉚?
((A+B)繡)+D=N?鉚?
((A+B)繡)-D=N?0鉚?
((A+B)繡)繢=N?1鉚?
((A+B)繡)罝=N?2鉚?
((A+B)罜)+D=N?3鉚?
((A+B)罜)-D=N?4鉚?
((A+B)罜)繢=N?5鉚?
((A+B)罜)罝=N?6鉚?
((A-B)+C)+D=N?7鉚?
((A-B)+C)-D=N?8鉚?
((A-B)+C)繢=N?9鉚?
((A-B)+C)罝=N?0鉚?
((A-B)-C)+D=N?1鉚?
((A-B)-C)-D=N?2鉚?
((A-B)-C)繢=N?3鉚?
((A-B)-C)罝=N?4鉚?
((A-B)繡)+D=N?5鉚?
((A-B)繡)-D=N?6鉚?
((A-B)繡)繢=N?7鉚?
((A-B)繡)罝=N?8鉚?
((A-B)罜)+D=N?9鉚?
((A-B)罜)-D=N?0鉚?
((A-B)罜)繢=N?1鉚?
((A-B)罜)罝=N?2鉚?
((A繠)+C)+D=N?3鉚?
((A繠)+C)-D=N?4鉚?
((A繠)+C)繢=N?5鉚?
((A繠)+C)罝=N?6鉚?
((A繠)-C)+D=N?7鉚?
((A繠)-C)-D=N?8鉚?
((A繠)-C)繢=N?9鉚?
((A繠)-C)罝=N?0鉚?
((A繠)繡)+D=N?1鉚?
((A繠)繡)-D=N?2鉚?
((A繠)繡)繢=N?3鉚?
((A繠)繡)罝=N?4鉚?
((A繠)罜)+D=N?5鉚?
((A繠)罜)-D=N?6鉚?
((A繠)罜)繢=N?7鉚?
((A繠)罜)罝=N?8鉚?
((A罛)+C)+D=N?9鉚?
((A罛)+C)-D=N?0鉚?
((A罛)+C)繢=N?1鉚?
((A罛)+C)罝=N?2鉚?
((A罛)-C)+D=N?3鉚?
((A罛)-C)-D=N?4鉚?
((A罛)-C)繢=N?5鉚?
((A罛)-C)罝=N?6鉚?
((A罛)繡)+D=N?7鉚?
((A罛)繡)-D=N?8鉚?
((A罛)繡)繢=N?9鉚?
((A罛)繡)罝=N?0鉚?
((A罛)罜)+D=N?1鉚?
((A罛)罜)-D=N?2鉚?
((A罛)罜)繢=N?3鉚?
((A罛)罜)罝=N?4鉚?
((A罛)+(C罝))=N?5鉚?
((A罛)-(C罝))=N?6鉚?
((A繠)+(C罝))=N?7鉚?
((A繠)-(C罝))=N?8鉚?
((A繠)+(C繢))=N?9鉚?
((A繠)-(C繢))=N?0鉚?
((A+B)?C+D))=N?1鉚?
((A+B)?C-D))=N?2鉚?
((A-B)?C-D))=N?3鉚?
C+D??(A+B)?C+D))=N?4鉚?
C-D??(A+B)?C-D))=N?5鉚?
C-D??(A-B)?C-D))=N?6鉚?
If T??
Then T鉖?
A鉏:B鉐:C鉑:D鉒?
Goto 2?
IfEnd?
If S=1?
Then E鉇:F鉈:G鉊:H鉉:2鉙?
Goto 1:IfEnd?
If S=2?
Then E鉇:F鉉:G鉈:H鉊:3鉙?
Goto 1:IfEnd?
If S=3?
Then E鉇:F鉉:G鉊:H鉈:4鉙?
Goto 1:IfEnd?
If S=4?
Then E鉇:F鉊:G鉈:H鉉:5鉙?
Goto 1:IfEnd?
If S=5?
Then E鉇:F鉊:G鉉:H鉈:6鉙?
Goto 1:IfEnd?
If S=6?
Then E鉈:F鉇:G鉉:H鉊:7鉙?
Goto 1:IfEnd?
If S=7?
Then E鉈:F鉇:G鉊:H鉉:8鉙?
Goto 1:IfEnd?
If S=8?
Then E鉈:F鉉:G鉇:H鉊:9鉙?
Goto 1:IfEnd?
If S=9?
Then E鉈:F鉉:G鉊:H鉇:10鉙?
Goto 1:IfEnd?
If S=10?
Then E鉈:F鉊:G鉇:H鉉:11鉙?
Goto 1:IfEnd?
If S=11?
Then E鉈:F鉊:G鉉:H鉇:12鉙?
Goto 1:IfEnd?
If S=12?
Then E鉉:F鉇:G鉈:H鉊:13鉙?
Goto 1:IfEnd?
If S=13?
Then E鉉:F鉇:G鉊:H鉈:14鉙?
Goto 1:IfEnd?
If S=14?
Then E鉉:F鉈:G鉇:H鉊:15鉙?
Goto 1:IfEnd?
If S=15?
Then E鉉:F鉈:G鉊:H鉇:16鉙?
Goto 1:IfEnd?
If S=16?
Then E鉉:F鉊:G鉇:H鉈:17鉙?
Goto 1:IfEnd?
If S=17?
Then E鉉:F鉊:G鉈:H鉇:18鉙?
Goto 1:IfEnd?
If S=18?
Then E鉊:F鉇:G鉈:H鉉:19鉙?
Goto 1:IfEnd?
If S=19?
Then E鉊:F鉇:G鉉:H鉈:20鉙?
Goto 1:IfEnd?
If S=20?
Then E鉊:F鉈:G鉇:H鉉:21鉙?
Goto 1:IfEnd?
If S=21?
Then E鉊:F鉈:G鉉:H鉇:22鉙?
Goto 1:IfEnd?
If S=22?
Then E鉊:F鉉:G鉇:H鉈:23鉙?
Goto 1:IfEnd?
If S=23?
Then E鉊:F鉉:G鉈:H鉇:24鉙?
Goto 1:IfEnd?
If S=24?
Then Goto 2?
IfEnd?
Lbl 2?
If P=0 And Z=0?
Then 1鉠?
1鉙?
-N鉔?
Goto 1?
IfEnd?
If P=0 And Z=1?
Then 2鉠?
1鉙?
-1罭鉔?
Goto 1?
IfEnd?
If P=0 And Z=2?
Then 3鉠?
1鉙?
-N鉔?
Goto 1?
IfEnd?
If P=0 And Z=3?
Then "---Not found??--"?
Y=2譍oto 4?
Goto 0?
IfEnd?
P?5譍oto 3?
Int ((P-1)?6)+1鉇?
Int ((P-16(A-1)-1)?)+1鉈?
MOD(P,4)鉉?
ClrText?
"[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]"?
Locate 5,3,"((     )   )"?
Z=1譒ocate 3,3,"-["?
Z=2譒ocate 2,3,"1籟"?
Z=3譒ocate 1,3,"-1籟"?
Locate 7,3,I?
A=1譒ocate 9,3,"+"?
A=2譒ocate 9,3,"-"?
A=3譒ocate 9,3,"??
A=4譒ocate 9,3,"??
Locate 10,3,J?
B=1譒ocate 13,3,"+"?
B=2譒ocate 13,3,"-"?
B=3譒ocate 13,3,"??
B=4譒ocate 13,3,"??
Locate 14,3,K?
C=1譒ocate 17,3,"+"?
C=2譒ocate 17,3,"-"?
C=3譒ocate 17,3,"??
C=0譒ocate 17,3,"??
Locate 18,3,L?
Z=1 Or Z=2 Or Z=3譒ocate 20,3,"]"?
Locate 19,4,"="?
Locate 20,4,M?
Y=2譍oto 4?
Goto 0?
Lbl 3?
P?1譍oto 5?
ClrText?
"[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]"?
Locate 5,3," (     ) (     )"?
Z=1譒ocate 3,3,"-["?
Z=2譒ocate 2,3,"1籟"?
Z=3譒ocate 1,3,"-1籟"?
Locate 7,3,I?
If P=65 Or P=66?
Then Locate 9,3,"??
Else Locate 9,3,"??
IfEnd?
Locate 10,3,J?
If P=65 Or P=67 Or P=69?
Then Locate 13,3,"+"?
Else Locate 13,3,"-"?
IfEnd?
Locate 15,3,K?
If P=69 Or P=70?
Then Locate 17,3,"??
Else Locate 17,3,"??
IfEnd?
Locate 18,3,L?
Z=1 Or Z=2 Or Z=3譒ocate 21,3,"]"?
Locate 19,4,"="?
Locate 20,4,M?
Y=2譍oto 4?
Goto 0?
Lbl 4?
1鉙?
M鉔?
RanBin#(1,13)鉇:RanBin#(1,13)鉈:RanBin#(1,13)鉉:RanBin#(1,13)鉊?
ClrText?
"CPU-RAN?
"?
Locate 2,2,A?
Locate 6,2,B?
Locate 10,2,C?
Locate 14,2,D?
A鉋:B鉌:C鉍:D鉎?
1鉙?
0鉏~L?
0鉖?
0鉠?
If ABCD<24?
Then 3鉠?
Goto 2?
IfEnd?
Goto 1?
Lbl 5?
ClrText?
"[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]"?
Locate 5,3," (     ) (     )"?
Z=1譒ocate 3,3,"-["?
Z=2譒ocate 2,3,"1籟"?
Z=3譒ocate 1,3,"-1籟"?
Locate 7,3,I?
If P=73 Or P=76?
Then Locate 9,3,"-"?
Else Locate 9,3,"+"?
IfEnd?
Locate 10,3,J?
If P=71 Or P=72 Or P=73?
Then Locate 13,3,"??
Else Locate 13,3,"??
IfEnd?
Locate 15,3,K?
If P=71 Or P=74?
Then Locate 17,3,"+"?
Else Locate 17,3,"-"?
IfEnd?
Locate 18,3,L?
Z=1 Or Z=2 Or Z=3譒ocate 21,3,"]"?
Locate 19,4,"="?
Locate 20,4,M?
Y=2譍oto 4?
Goto 0?

M-POINT.G1M

3.97 KB, 下载次数: 17, 下载积分: 金钱 -1

评分

参与人数 1金钱 +6 收起 理由
Ulysses + 6 不错,虽然算法待改进。

查看全部评分

发表于 2010-8-6 10:28:46 | 显示全部楼层
解闷还是玩独立钻石.
发表于 2010-8-6 12:39:30 | 显示全部楼层
我还想在nspire上写这个....
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cnCalc计算器论坛

GMT+8, 2024-12-22 11:01 , Processed in 0.076660 second(s), 32 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表