登录
首页 » C# » 面这段代码模拟了龟兔赛跑爬山的情况,其中有个时钟触发设置每秒执行一次循环,乌龟的规则是:50% 的机会快走(右移三格) 20% 的机会下滑(左移六格) 30%...

面这段代码模拟了龟兔赛跑爬山的情况,其中有个时钟触发设置每秒执行一次循环,乌龟的规则是:50% 的机会快走(右移三格) 20% 的机会下滑(左移六格) 30%...

于 2022-05-21 发布 文件大小:2.45 kB
0 86
下载积分: 2 下载次数: 1

代码说明:

面这段代码模拟了龟兔赛跑爬山的情况,其中有个时钟触发设置每秒执行一次循环,乌龟的规则是:50% 的机会快走(右移三格) 20% 的机会下滑(左移六格) 30% 的机会慢走(右移一格). 兔子的规则是:20% 的机会睡觉(不移动) 20% 的机会大跳(右移九格) 10% 的机会大滑(左移十二格) 30% 的机会小跳(右移一格) 20% 的机会小滑(左移两格). 其中最先走到整 70 格的胜利,超过 70 格的从头开始 程序在一条线上打印了龟兔移动的轨迹,当两者重合时打印 P 乌龟用 G 表示,兔子用 T 表示. -face this code to simulate the hand of the mountain, which has a clock installed trigger the implementation of a second cycle of the turtle is a rule : 50% chance of brisk walking (3 Georgia shift to right) 20% chance of decline (6 bits grid) 30% chance of walking (a shift to right field) . rabbit is a rule : 20% of the opportunity to sleep (mobile) 20% chance of play (9 Georgia shift to right) 10% of the opportunities in Waterloo (12 bits grid) 30% chance of a small jump (shift to right a grid) 20% chance of a small slip (2 bits grid). One of the most first come the whole grid of 70 victories, more than 70 grid start again from scratch in a process of the turtles online print rabbit mobile track, when the two P Print coincides wit

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • HCTL-2032-Encoder
    1 两路编码器输入通道 2 采用专用编码器计数芯片完成计数工作 3 与上位机串口通讯(1 two-way encoder input channel 2 using a dedicated encoder chip count as counting work 3 serial communication with the host computer)
    2016-01-19 16:02:28下载
    积分:1
  • LCD_nokia5110
    LCD_nokia5110. C51程序。 LCD_nokia5110. C51程序。(LCD_nokia5110)
    2009-07-11 16:39:15下载
    积分:1
  • 79867564
    使用代码控制文字滚动,C++Builder精选编程学习源码,很好的参考资料。(Use code to control the rolling text, C++Builder select learning programming source code, a good reference.)
    2013-11-22 06:43:21下载
    积分:1
  • ADI DSP 伺服
    一款基于ADI DSP开源伺服驱动方案源码,含转矩环,速度环各位置,可以用于开发工业伺服 CNC等设备参考。
    2022-01-25 21:43:02下载
    积分:1
  • 你曾经经历过的错误加载DLL当你启动一个应用而…
    Have you ever experienced an error while loading a DLL when you start an application? Invalid DLL version? Entry point @XXXX not found? -Have you ever experienced an error while lo ading a DLL when you start an application Invali DLL version d @ XXXX Entry point not found
    2022-03-23 04:34:44下载
    积分:1
  • shenyangbusquerysystem
    沈阳公交查询系统 沈阳公交查询系统(Shenyang Shenyang Bus Inquiry System Bus Inquiry System)
    2008-05-27 21:04:20下载
    积分:1
  • Binary_tree
    二叉树的C++实现,成员可以自己调整,实现了各种修剪此树的方法:初始化,增加节点,删去节点,复制树,读取节点,遍历树(Binary tree in C++, members can make their own adjustments to achieve a variety of pruning this tree methods: initialize, add nodes, delete nodes, copy the tree, read the node, traverse the tree)
    2011-10-22 23:51:28下载
    积分:1
  • chat
    Visual C++ 实现的聊天程序,实现聊天室功能,可以运行。(The chat program Visual C++ achieve chat rooms function, you can run.)
    2013-04-23 22:08:49下载
    积分:1
  • ppt&src
    C语言基础课件包含ppt,需要的朋友可以下载学习。(C language basic courseware contains PPT, and the friends you need can download and study.)
    2017-11-09 23:09:28下载
    积分:1
  • robotic
    robotic code fore rotation
    2011-01-04 03:35:42下载
    积分:1
  • 696516资源总数
  • 106442会员总数
  • 11今日下载