- 追加された行はこの色です。
- 削除された行はこの色です。
#define A 123
#define B 234
#define C 345
#define D 456
#define E 567
#define F 678
#define G 789
#define H 890
#define I 901
#define P PlayTone
#define W Wait
task main()
{
while(true)
{
P(E,20);W(40);
P(D,20);W(30);
P(C,20);W(40);
P(B,10);W(30);
P(A,10);W(20);
俺に名前は必要ない。なぜなら羽田空港のビルだからだ。
しかも二番目の存在。だが、俺はそれでもいいと思っている。
自分の地位も名誉も、名前同様俺には必要ない。
俺に必要なのはエビフライだ。
*試作品 [#g94de956]
#define DO1 880
#define DO01 932
#define RE1 988
#define MI1 1047
#define MI01 1109
#define FA1 1175
#define FA01 1245
#define SO1 1319
#define LA1 1397
#define LA01 1480
#define SHI1 1568
#define SHI01 1661
#define DO2 1760
#define P PlayTone
#define W Wait
task play_music() {
while(true)
{
P(RE1,10);W(10);
P(MI1,10);W(10);
P(FA1,10);W(10);
P(SO1,10);W(10);
P(LA1,10);W(20);
P(LA1,10);W(10);
P(SO1,10);W(10);
P(FA1,10);W(10);
P(MI1,10);W(10);
P(RE1,10);W(20);
P(RE1,10);W(10);
P(MI1,10);W(10);
P(FA1,10);W(10);
P(SO1,10);W(10);
P(LA1,5);W(5);
P(LA1,5);W(10);
P(LA1,10);W(10);
P(SO1,10);W(10);
P(FA1,10);W(10);
P(MI1,10);W(10);
P(DO01,25);W(30);
#define blackline 30
#define Go_time 200
int frag;
sub linetrace (){
if ((SENSOR_1 <= blackline) && (SENSOR_3 <= blackline)){
OnFwd(OUT_A + OUT_C);
Wait(030);
frag++;
}
}
#define A 123
#define B 234
#define C 345
#define D 456
#define E 567
#define F 678
#define G 789
#define H 890
#define I 901
task play_music2() {
while(true)
{
P(E,20);W(40);
P(D,20);W(30);
P(C,20);W(40);
P(B,10);W(30);
P(A,10);W(20);
P(A,20); W(30);
P(C,5); W(10);
P(D,20); W(25);
P(F,20); W(25);
P(E,20); W(25);
P(D,10);W(25);
P(C,5);W(10);
P(C,10);W(10);
P(C,5);W(10);
P(C,10);W(10);
}
}
#define turn_right OnFwd(OUT_A);OnRev(OUT_C);
#define turn_left OnRev(OUT_A);OnFwd(OUT_C);
#define stop_turning Off(OUT_A+OUT_C);
#define TURN_TIME 400
#define go OnFwd(OUT_A+OUT_C); task main () {
task main ()
SetSensor(SENSOR_1,SENSOR_LIGHT);
SetSensor(SENSOR_3,SENSOR_LIGHT);
ClearTimer(0);
turn_right;
start play_music;
while(FastTimer(0)<TURN_TIME){
if((SENSOR_1>light_max)||(SENSOR_3>light_max))
{
light_max=SENSOR_1 || light_max=SENSOR_3;
time_max=FastTimer(0);
}
else{
if ((SENSOR_1 <= blackline) && (SENSOR_3 >= blackline)){
OnRev(OUT_A);OnFwd(OUT_C);
}
if ((SENSOR_1 >= blackline) && (SENSOR_3 <= blackline)){
OnFwd(OUT_C);OnRev(OUT_A);
}
if ((SENSOR_1 >= blackline) && (SENSOR_3 >= blackline)){
OnFwd(OUT_A + OUT_C);
}
}
stop_turning;
stop play_music;
Wait(100);
OnFwd(OUT_C);OnRev(OUT_A);
Wait(TURN_TIME-time_max);
Off(OUT_A+OUT_C);
while(true){
if(SENSOR_1>=light_max){
OnFwd(OUT_A+OUT_C);
}else{
start play_music;
OnFwd(OUT_A);OnRev(OUT_C);
until(SENSOR_1>=light_max);
stop play_music;
}
}
sub hold_can (){
Wait (020);
OnFwd(OUT_B);
Wait(150);
Off(OUT_B);
OnRev(OUT_A+OUT_B);
Wait(Go_time+300);
}
sub port_can (){
OnRev(OUT_B);
Wait (250);
Off(OUT_B);
OnFwd (OUT_A+OUT_C);
Wait (040);
Off (OUT_A+OUT_C);
}
sub go_straight (){
OnFwd (OUT_A+OUT_C);
}
sub go_down (){
OnRev (OUT_A+OUT_C);
}
sub turn_R (){
Off (OUT_A + OUT_C);OnRev (OUT_A+OUT_C);Wait (030);OnFwd (OUT_A);Wait (150);Off (OUT_A+OUT_C);
}
sub turn_L (){
Off (OUT_A + OUT_C);OnRev (OUT_C+OUT_A);Wait (030);OnFwd(OUT_C);Wait (150);Off (OUT_A+OUT_C);
}
task main(){
SetSensor (SENSOR_1, SENSOR_LIGHT);
SetSensor (SENSOR_3, SENSOR_LIGHT);
frag=0;
while (true){
if (frag == 0){
hold_can();
go_down ();
until((SENSOR_1<=blackline)&&(SENSOR_3<=blackline));
OnFwd(OUT_A);OnRev(OUT_C);
until((SENSOR_1<=blackline)&&(SENSOR_3>=blackline));
linetrace();
}
}
P(A,20); W(30);
P(C,5); W(10);
P(D,20); W(25);
P(F,20); W(25);
P(E,20); W(25);
P(D,10);W(25);
P(C,5);W(10);
P(C,10);W(10);
P(C,5);W(10);
P(C,10);W(10);
}
if (frag == 1){
linetrace();
}
if (frag == 2){
OnFwd(OUT_A);OnRev(OUT_C);
until((SENSOR_1<=blackline)&&(SENSOR_3>=blackline));
linetrace();
}
if (frag == 3){
port_can();
frag=0;
}
}
}