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

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

于 2022-05-21 发布 文件大小:2.45 kB
0 97
下载积分: 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 个回复

  • STM32F103C8T6控制继电器输出
    STM32F103控制继电器输出,可扩展应用至其他程序(STM32F103 Control Relay Output)
    2021-01-20 15:28:41下载
    积分:1
  • dephi编程基础教程,介绍dephi编程以及相关函数的使用。
    dephi编程基础教程,介绍dephi编程以及相关函数的使用。-dephi program basic
    2022-01-31 07:41:05下载
    积分:1
  • CSharp-CTP
    上期CTP接口C#封装 可以使用该封装进行期货交易,并且可以搭建自己的程序化交易平台(CTP C# interface)
    2014-03-19 22:04:07下载
    积分:1
  • RDP
    说明:  可以在嵌入式arm上运行的RDP application(RDP app for arm ,remote desktop for windows and linux,i have run it on SMX successful)
    2019-03-17 13:02:10下载
    积分:1
  • 基于Miracl大数运算库实现SM2算法
    说明:  基于Miracl大数运算库实现SM2算法,包含加密和签名算法,纯C语言实现,包含Miracl库手册。提供了Linux平台下的Makefile文件,可直接运行。Windows平台需要重新建立项目工程。(SM2 algorithm based on miracl large arithmetic library, including encryption and signature algorithm, pure c language implementation, including miracl library manual. The makefile file under linux platform is provided, which can run directly. windows platform need to re-establish project engineering.)
    2020-07-04 13:00:02下载
    积分:1
  • 93940483
    说明:  A simple example of audio communication, using a full-duplex mode of communication,
    2019-04-02 23:58:17下载
    积分:1
  • C Answer Book_1989.pdf
    经典C语言书上的练习的答案,手边放一本非常方便。C语言的学习光看书没有用,必须做练习,这个答案帮助很大。(The C Answer Book. Solutions to the Exercises in The C Programming Language, Second Edition by Brian W. Kernighan and Dennis M. Ritchie)
    2017-07-21 07:15:47下载
    积分:1
  • OPENGL_GIS
    铁路三维地形漫游系统,使用OpenGL、VC、Oracle编写(Railway 3D Terrain System, using OpenGL, the VC, Oracle write )
    2020-09-13 15:57:58下载
    积分:1
  • 包含几个单片机实验程序,全部用C编写,是单片机初学者的良好实验教材。...
    包含几个单片机实验程序,全部用C编写,是单片机初学者的良好实验教材。-Contains several single-chip experimental procedure, all prepared with C is a good single-chip experimental teaching materials for beginners.
    2022-02-06 17:42:33下载
    积分:1
  • IC4094驱动代码
     IC4094-IO口扩展芯片驱动源代码
    2022-03-15 08:16:37下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载