加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python开发_自己开发的一个小游戏

发布时间:2020-12-17 00:18:34 所属栏目:Python 来源:网络整理
导读:先看看游戏的运行效果: 看完游戏的运行情况,你可能对游戏有了一定了了解: 代码部分: language_option = enter_str = en_game_start_str = cn_game_start_str = en_game_rule_str = cn_game_rule_str = en_game_over_str = cn_game_over_str = number = n

先看看游戏的运行效果:

看完游戏的运行情况,你可能对游戏有了一定了了解:

代码部分:

language_option = enter_str = en_game_start_str = cn_game_start_str = en_game_rule_str = cn_game_rule_str = en_game_over_str = cn_game_over_str = number = num == ( num == 1 ( num == 2 ( num == 3 ( num == 4 ( num == 5 ( num == 6 ( num == 7 ( num == 8 ( num == 9 ( ( num == 1 num == 2 n = number == 1 start_game(1 number == 2 start_game(2 exit()

才刚开始接触python,希望志同道合的朋友一起学习python....

下面是对以上程序的改进:

优化了print_info()方法,增加了询问玩家是继续玩功能..详细请参看代码

language_option = enter_str = en_game_start_str = cn_game_start_str = en_game_rule_str = cn_game_rule_str = en_game_over_str = cn_game_over_str = en_list = [,,,,,,,,, cn_list = [,,,,,,,,, FLAG = en_play_again_str = cn_play_again_str = number = num range(0,9 ( num == 1 num == 2 n = n == 1 n == 2 again = again == 1 again == 2 FLAG = number == 1 start_game(1 play_again(1 number == 2 start_game(2 play_again(2

运行效果:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读