AliMD / 1Tuts

:+1: Web Design Technology Tutorials
http://ali.md/tuts
62 stars 41 forks source link

C14 W3 S2 #627

Closed AliMD closed 10 years ago

AliMD commented 10 years ago

Class Work

che khoobe vaghti baghiye nistan mishe kolli bahse ezafe goft hadaf yek alguritm baraye halle hamaye marahel va halate ghayebin code haye in jalase ro aslan kar nakonid ke ghat mizanin hamoon jalaseye ghabl ro kamel befahmid bezarid inaro dars bedam behetoon

#include "robot.h"

void go(){
  say("going");
  while(look()==Void){
    forward();
  }
}

void rotate(){
  say("rotating");
  left();
  left();
}

void throwRock(){
  say("throw the rock");
  take();
  rotate();
  drop();
  rotate();
}

void turn(){
  say("Tasmime kobra");
  left();
  if(look()==Wall) rotate();
}

void findTheDoor(){
  say("Finding the door");

  if(look()==Exit) return;

  go();

  if(look()==Rock) throwRock();

  if(look()==Wall) turn();

  findTheDoor();
}

void celebration(){
  say("Hoooorrrrrraaaaaa");
  escape();
  while(true) left(); // for fun
}

void ant(){
  say("be nam khoda ;)");

  findTheDoor();

  celebration();
}
akbarzadeamin commented 10 years ago
#include "robot.h"

void go(){
while(look()==Void){
  forward();
  }
}
void ant(){
while(look()==Void){
  go();
  left();
  }
  escape();
}
akbarzadeamin commented 10 years ago

in baraye 4a laby hast

hbehkamal commented 10 years ago

reserved();

AliMD commented 10 years ago

class emrooz (shanbe) cancel

baraye 3shanbe hatman ghayebin tamrin haye anjam shodaro test konan