项目后期维护,没什么事情干,闲着无聊,今天写了个小游戏玩玩:
(注:由于代码不能从客户那边带回来,回家用记事本写的,注释也比较少,但是代码实现的逻辑很简单,不解释。。。。。 如有编译错误请谅解, 灰常感谢!!!!)
report ......
selection-screen pushbutton 2(10) pb11 user-command pb11.
selection-screen pushbutton 12(10) pb12 user-command pb12.
selection-screen pushbutton 22(10) pb13 user-command pb13.
selection-screen skip.
selection-screen pushbutton 2(10) pb21 user-command pb21.
selection-screen pushbutton 12(10) pb22 user-command pb22.
selection-screen pushbutton 22(10) pb23 user-command pb23.
selection-screen skip.
selection-screen pushbutton 2(10) pb31 user-command pb31.
selection-screen pushbutton 12(10) pb32 user-command pb32.
selection-screen pushbutton 22(10) pb33 user-command pb33.
selection-screen skip.
selection-screen pushbutton 12(10) pbrt user-command pbrt.
INITIALIZATION.
"设定画面的初始值
pb11 = '2'.
pb12 = '1'.
pb13 = '4'.
pb21 = '7'.
pb22 = '3'.
pb23 = '6'.
pb31 = '8'.
pb32 = ' '.
pb33 = '5'.
at selection-screen.
case sy-ucomm.
when 'pb11'.
perform exec_pb11.
when 'pb12'.
perform exec_pb12.
when 'pb13'.
perform exec_pb13.
when 'pb21'.
perform exec_pb21.
when 'pb22'.
perform exec_pb22.
when 'pb23'.
perform exec_pb23.
when 'pb31'.
perform exec_p

这篇博客展示了作者在项目后期维护阶段出于娱乐心态,使用ABAP编写的一个数字移动小游戏。游戏界面包含9个按钮,玩家通过点击将数字移动到空白位置,目标是排列成特定顺序。代码中定义了各种按钮的用户命令,并实现了点击按钮时数字的移动逻辑以及检查正确结果的功能。
最低0.47元/天 解锁文章
1709

被折叠的 条评论
为什么被折叠?



