子版块

Python/Java/C程序设计

今日课程:0  |  课程总数:16
使用Python/Java/C程序编写机器人程序。 适用年龄: 10-18岁
admin
5510
******跳舞************************/void Dance(){ int i = 0; int j = 100; int rand_angles = 0; int rand_num = 0; while(1){ rand_angles = random(i) % 90 + 90; rand_num = random(j) % 2; if(rand_num == 1) turn_right(rand_angles); else turn_left(rand_angles); i++; j++; }}Dance();void main(){}/*******************念唐诗****************************/void Say_poem(){ gpp_say(1,"桃花溪"); gpp_say(1,"作者张旭"); gpp_say(1,"隐隐飞桥隔野烟,石矶西畔问渔船。 桃花尽日随流水,洞在清溪何处边。");}Say_poem();void main(){}/********************英语自我介绍**********************/void Introduce_E(){ gpp_say(1,"I am uwis robot,I will become your good friend,I will always stay with you");}Introduce_E();void main(){}/**********************跳舞说话*****************************/void Dance_Say(){ int i = 0; while(i <= 5) { gpp_say(1,"我是UWIS智能机器人"); turn_left(90); turn_right(90); gpp_say(1,"I am uwis intelligent robot"); turn_right(90); turn_right(50); gpp_say(1,"我会成为你的好朋友"); turn_left(90); turn_right(90); gpp_say(1,"I will become your good friend"); turn_right(90); turn_right(90); i++; }}Dance_Say();void main(){}/**********************扫地机器人*************************************/void Sweep_Floor(){ int distance = 0; while(1){ distance = distsensor(); if(distance < 5) turn_left(90); forward(5,10); wait(5); } }Sweep_Floor();void main(){}以上就是我简单介绍的几个例子。。。。。。。。。。
0   2017-12-05 10:08:18
xh20160214
4461
 0
[Image]
0   2019-03-10 19:47:25
xh20160214
4721
 0
[Image]
0   2019-03-10 19:41:38
xh20160214
4596
 0
[Image]
0   2019-03-10 19:38:31
xh20160214
4383
 0
[Image]
0   2019-03-10 19:02:12
xh20160214
4396
 0
[Image]
0   2019-03-10 18:59:45
xh20160214
4562
 0
[Image]
0   2019-02-24 13:43:58
xh20160214
4410
 0
[Image]
0   2019-02-19 13:32:03
xh20160214
5866
 0
                游戏迷宫第10关可谓步步陷阱,处处坑。路径极其复杂,分前方有路,前方无路两种情况,其中每种情况又分前方路径向左向右两种,路程长度也不相同。设计者又非常抠门,只给了10个模块,这使得前行路上险象环生,很容易功败垂成。下面就游戏模块搭建思路与诸君共享。        首先设置循环体,两个向前移动模块,使人偶到达路口,再下接分支判断模块,选前方有路,带"其他"选项那种,由于第一和第二个路口,前方都有路,而到达目的地的路径既要向左,又需要向右,显然,这一个条件无法满足要求,这里需采用复合条件加以判定,第一个路口只有向左路径,第二个路口有左右路径,在这里增加一个前方路径向右的判断模块,放在前方有路模块中执行框中,构成复合判断句,第一个路口路径没有向右,故执行其他分支模块,这里放的是向左转模块,这时人偶不会向左,而是向右转。这样,人偶到达第三个路口,正好前方无路,执行这里放置的向左转,向前移动,向右转三个模块后,到达第四个路口,并正对着目标,这时会执行循环模块中向前移动程序,到达目的地,取得真经。
0   2019-02-19 12:55:48
xh20160214
6041
 0
这是优唯思中迷宫游戏10关,非常复杂,对专业编程人员也非易事,这里将其JavaScript源代码与大家分享。对程序中可能的缺陷,敬请斧正。while ( notDone( )){    moveForward( );    moveForward( );    if ( isPathForward( ))    {        if ( isPathRight( ))        {            turnRight( );        }        else        {            turnLeft( );         }    }    else    {        turnLeft( );        moveForward( );        turnRight( );    }}
0   2019-02-16 16:07:53
xh20160214
4659
 0
[Image]
0   2019-02-15 19:12:04
暂无班级信息
等级:0级
优币:
好奇少年:
最新作业
左邻右舍
{"竞赛编程":"http://www.uwis.cn/uide/","课程编辑":"http://www.135editor.com/","成信大":"http://www.cuit.edu.cn","老版优唯思":"http://old.uwis.cn","图文发帖":"http://yz.uwis.cn/index.php?c=edit&type=read&pyteditorload=no"}

©2015 - 2024 优唯思编程   |   Copyright 2015 All Rights 成都优威骐骥教育科技有限公司  |  网站备案号:蜀ICP备16015136号