Adam ton2.nxc

From RoboWiki
Jump to: navigation, search

Krúžok Robotiky

/* adam_ton2.nxc

  Program hra nahododnu melodiu.
  
  Autor: Adam Trizuljak
*/


//#DEFINE cas1 150
int ton, cas1, cas2; //premenne ton, cas1 a cas2



task main()
{
 cas1=200; //nastav cas1 na 200
 while(1)
 {
 ton=random(3600)+400; //premenna ton = nahod. c. do 3600+400
 PlayTone(ton,cas1); //zahraj ton podla ton a cas
 PlaySound(
 cas2=random(1000); //cas2 = nahod c do 1000
 Wait(cas2); //cakaj podla cas2
  }
}