piste
... dohoda a odmena !
Piste
RP
... dohoda a odmena !
Piste



This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Zobrazi� pr�spevky Menu/*
* main.c
*/
#include "impl/karel.h"
#include "pomocne-prikazy.h"
/* tu si pisete svoje funkcie */
/* preskoci akukolvek prekazku */
void preskoc() {
turnLeft();
/* vylez hore */
while(rightIsBlocked()) {
movek();
}
turnRight();
movek();
turnRight();
/* zlez */
movekAll();
turnLeft();
}
void behaj() {
/* opakuj pokial karel nenajde beeper */
while(!beepersPresent()) {
if(frontIsBlocked()) {
/* ked je prekazka, preskoc ju */
preskoc();
} else {
/* ked nie je prekazka, chod dopredu */
movek();
}
}
}
/* behaj spat na zaciatok */
void behajSpat() {
/* dorobit */
}
int movekAll() {
int kolko;
while(frontIsClear()) {
movek();
kolko++;
}
return ++kolko;
}
void akeSiroke() {
turnWest();
movekAll();
turnEast();
movekAll();
turnWest();
}
void akeVysoke() {
turnSouth();
movekAll();
turnNorth();
}
int main(){
int kolko;
nemamCas();
turnOn("worlds/middleearth2.kw");
turnNorth();
movekAll();
akeSiroke();
kolko = kolko/2;
while(kolko>0){
movek();
kolko++;
}
akeVysoke();
kolko = kolko/2;
while(kolko>0){
movek();
kolko++;
}
turnOff();
}