文件名称:上古神器
介绍说明--下载内容来自于网络,使用问题请自行百度
代码模拟了龟兔赛跑爬山的情况,其中有个时钟触发设置每秒执行一次循环,乌龟的规则是:50% 的机会快走(右移三格) 20% 的机会下滑(左移六格) 30% 的机会慢走(右移一格).
兔子的规则是:20% 的机会睡觉(不移动) 20% 的机会大跳(右移九格) 10% 的机会大滑(左移十二格) 30% 的机会小跳(右移一格) 20% 的机会小滑(左移两格).
其中最先走到整 70 格的胜利,超过 70 格的从头开始 程序在一条线上打印了龟兔移动的轨迹,当两者重合时打印 P 乌龟用 G 表示,兔子用 T 表示.
-code to simulate the hand of the mountain, which has a clock installed trigger a cycle per second, turtle is a rule : 50% of the opportunity to leave (three grid shift to right) 20% chance of decline (6 bits grid) 30% chance of walking (a shift to right Lattice). 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 Lattice) 30% chance of a small jump (shift to right a grid) 20% chance of a small slip (2 bits grid). the first of them go the whole 70 Lattice victory over 70 grid start again from scratch in a process of the turtles online print rabbit mobile track, when the two P Print coincides with the G turtles, rabbits with T said.
兔子的规则是:20% 的机会睡觉(不移动) 20% 的机会大跳(右移九格) 10% 的机会大滑(左移十二格) 30% 的机会小跳(右移一格) 20% 的机会小滑(左移两格).
其中最先走到整 70 格的胜利,超过 70 格的从头开始 程序在一条线上打印了龟兔移动的轨迹,当两者重合时打印 P 乌龟用 G 表示,兔子用 T 表示.
-code to simulate the hand of the mountain, which has a clock installed trigger a cycle per second, turtle is a rule : 50% of the opportunity to leave (three grid shift to right) 20% chance of decline (6 bits grid) 30% chance of walking (a shift to right Lattice). 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 Lattice) 30% chance of a small jump (shift to right a grid) 20% chance of a small slip (2 bits grid). the first of them go the whole 70 Lattice victory over 70 grid start again from scratch in a process of the turtles online print rabbit mobile track, when the two P Print coincides with the G turtles, rabbits with T said.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.