CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - lattice p
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
Shot Game
Game Server Simulator
Chess Poker games
Game Engine
Other Riddle games
Mobile games
Other Games
Search - lattice p - List
[
Game Program
]
上古神器
DL : 0
代码模拟了龟兔赛跑爬山的情况,其中有个时钟触发设置每秒执行一次循环,乌龟的规则是: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.
Date
: 2008-10-13
Size
: 1.24kb
User
:
单士占
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.