2006a/A4/NRLPの研究室

もるだうおんりー.ver

制作日時:7月6日

#define pika 36
#define zen OnFwd(OUT_A+OUT_B);
#define hidari OnFwd(OUT_C);OnRev(OUT_A);
#define migi OnFwd(OUT_A);OnRev(OUT_C);

#define C  523
#define Ces 554
#define D  587
#define Des 622
#define E  659
#define F  698 
#define Fes 740
#define G 784
#define Ges 831
#define A 880 
#define Aes 932
#define H 988
#define C8th  1047
#define C8thes 1109
task morudau()
{
while(true)
  {
  PlayTone(C,20); Wait(20);
  PlayTone(F,35); Wait(40);
  PlayTone(G,20); Wait(20);
  PlayTone(Ges,35); Wait(40);
  PlayTone(Aes,18); Wait(20);
  PlayTone(C8th,35); Wait(40);
  PlayTone(C8th,16); Wait(20);
  PlayTone(C8th,55); Wait(60);
  PlayTone(C8thes,55); Wait(60);
  PlayTone(C8thes,55); Wait(60);
  PlayTone(C8th,90); Wait(100);
 
  PlayTone(C8th,18); Wait(20);
  PlayTone(Aes,38); Wait(40);
  PlayTone(C8th,18); Wait(20);
  PlayTone(Aes,38); Wait(40); 
  PlayTone(Aes,18); Wait(20); 
  PlayTone(Ges,38); Wait(40);
  PlayTone(Aes,18); Wait(20);
  PlayTone(Ges,58); Wait(60);

  PlayTone(G,58); Wait(60);
  PlayTone(G,58); Wait(60);
  PlayTone(F,118); Wait(120);

  Wait(200);
  }
}

task main()
{
	SetSensor(SENSOR_1,SENSOR_LIGHT);
	SetSensor(SENSOR_3,SENSOR_LIGHT);
	while(true)
	  {
	     if(SENSOR_1<pika&&SENSOR_3>pika)
	       {
	       stop morudau;
             migi;
	       Wait(11);
             }
	     if(SENSOR_1>pika&&SENSOR_3<pika)
	       {
	       stop morudau;
             hidari;
	       Wait(11);
	       }
	     if(SENSOR_1<pika&&SENSOR_3<pika)
	       {    
           while(SENSOR_1<pika||SENSOR_3<pika)
                {
                start morudau;
                migi;
	          Wait(11);
	          until(SENSOR_1>pika||SENSOR_3>pika);
	          }
             }
	     if(SENSOR_1>pika&&SENSOR_3>pika)
	       {
	       stop morudau;
	       zen;
	       }
        }
}

もるだうところぶちか.ver

制作日時:7月6日

#define pika 36
#define zen OnFwd(OUT_A+OUT_B);
#define hidari OnFwd(OUT_C);OnRev(OUT_A);
#define migi OnFwd(OUT_A);OnRev(OUT_C);

#define C  523
#define Ces 554
#define D  587
#define Des 622
#define E  659
#define F  698 
#define Fes 740
#define G 784
#define Ges 831
#define A 880 
#define Aes 932
#define H 988
#define C8th  1047
#define C8thes 1109

task morudau()
{
while(true)
  {
  PlayTone(C,20); Wait(20);
  PlayTone(F,35); Wait(40);
  PlayTone(G,20); Wait(20);
  PlayTone(Ges,35); Wait(40);
  PlayTone(Aes,18); Wait(20);
  PlayTone(C8th,35); Wait(40);
  PlayTone(C8th,16); Wait(20);
  PlayTone(C8th,55); Wait(60);
  PlayTone(C8thes,55); Wait(60);
  PlayTone(C8thes,55); Wait(60);
  PlayTone(C8th,90); Wait(100);

  PlayTone(C8th,18); Wait(20);
  PlayTone(Aes,38); Wait(40);
  PlayTone(C8th,18); Wait(20);
  PlayTone(Aes,38); Wait(40); 
  PlayTone(Aes,18); Wait(20); 
  PlayTone(Ges,38); Wait(40);
  PlayTone(Aes,18); Wait(20);
  PlayTone(Ges,58); Wait(60);

  PlayTone(G,58); Wait(60);
  PlayTone(G,58); Wait(60);
  PlayTone(F,118); Wait(120);

  Wait(200);
  }
}

task  korobu()
{
  while(true)
  {
  PlayTone(A,35); Wait(40);
  PlayTone(E,15); Wait(20);
  PlayTone(F,15); Wait(20);
  PlayTone(G,35); Wait(40);
  PlayTone(A,2); Wait(2);
  PlayTone(G,3); Wait(3);
  PlayTone(F,12); Wait(15);
  PlayTone(E,15); Wait(20);
  PlayTone(D,35); Wait(40);
  PlayTone(D,15); Wait(20);
  PlayTone(F,15); Wait(20);
  PlayTone(A,35); Wait(40);
  PlayTone(H,2); Wait(2);
  PlayTone(A,3); Wait(3);
  PlayTone(G,12); Wait(15);
  PlayTone(F,15); Wait(20);
  PlayTone(E,35); Wait(40);
  PlayTone(E,15); Wait(20);
  PlayTone(F,15); Wait(20);
  PlayTone(G,35); Wait(40);
  PlayTone(A,35); Wait(35);
  PlayTone(F,35); Wait(40);
  PlayTone(D,35); Wait(40);
  PlayTone(D,75); Wait(80);
  Wait(80);
  }
}
task main()
{
	SetSensor(SENSOR_1,SENSOR_LIGHT);
	SetSensor(SENSOR_3,SENSOR_LIGHT);
	while(true)
	  {
	     if(SENSOR_1<pika&&SENSOR_3>pika)
	       {
             migi;
	       Wait(11);
             }
	     if(SENSOR_1>pika&&SENSOR_3<pika)
	       {
             hidari;
	       Wait(11);
	       }
	     if(SENSOR_1<pika&&SENSOR_3<pika)
	       {    
           while(SENSOR_1<pika||SENSOR_3<pika)
                {
                start morudau;
                stop korobu;
                migi;
	          Wait(11);
	          until(SENSOR_1>pika||SENSOR_3>pika);
	          }
             }
	     if(SENSOR_1>pika&&SENSOR_3>pika)
	       {
	       stop morudau;
	       start korobu;
	       zen;
	       }
        }
}

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2006-07-06 (木) 21:02:06 (4795d)