• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

kelly_Dai

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

软工作业一

【1】程序运行截图

【2】以下为按照代码格式修改后的部分,游戏规则修改为之前捐款不足4人,则无法从捐款箱中取硬币。

  ##修改Threshold参数为9 
  i=0 if flag > Threshold: # 放硬币 delta = random.randint(1,Max_DonateCoin) delta = random.randint(1,delta) Box_sum = Box_sum + delta i=i+1          # 修改:对先前捐款人数计数 Box_per_remain.append(Box_sum) else: # 取硬币 if i >= 4: delta = random.randint(1,Max_TakeCoin) delta = random.randint(delta,Max_TakeCoin) if Box_sum < delta: Box_sum = 0 else: Box_sum = Box_sum - delta Box_per_remain.append(Box_sum) i=0          #有一人取款则捐款计数清空

 

 [3]git步骤

 

 

 远端仓库连接:http://git.oschina.net/opopi/homework1

posted on 2017-09-16 13:04  kelly_Dai  阅读(172)  评论(1)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3