「弥」のプログラム †ペンに関する定義 †#define pen_down OnRev(OUT_A);Wait(100);Off(OUT_A) //ペンを下げる #define pen_up OnFwd(OUT_A);Wait(100);Off(OUT_A) //ペンを上げる 移動に関する定義 †#define move_up OnFwd(OUT_B+OUT_C) // 前進 #define move_down OnRev(OUT_B+OUT_C) // 後退 #define move_right OnFwd(OUT_B);OnRev(OUT_C) // 右に回る #define move_left OnFwd(OUT_C);OnRev(OUT_B) // 左に回る #define move_stop Float(OUT_B+OUT_C) // スムーズに止まる #define st Off(OUT_B+OUT_C) // 止まる 時間に関する定義 †#define time_a 50 #define time_b 25 #define time_c 40 #define time_d 50 #define time_e 10 #define time_f 40 #define time_g 40 #define time_h 70 #define time_i 100 #define time_j 20 サブ・ルチーン †sub turn_right() //右に90°回転 { move_right; Wait(89); } sub turn_left() //左に90°回転 { move_left; Wait(89); } メイン・プログラム †task main() { 「弥」の一画目 †pen_down; move_up; Wait(time_a); turn_right(); move_up; Wait(time_b); st; pen_up; Wait(100); 二画目までの移動 †turn_right(); move_up; Wait(time_a); st; 「弥」の二画目 †pen_down; Wait(100); move_down; Wait(time_a); st; pen_up; Wait(100); 三画目までの移動 †move_up; Wait(time_a); st; turn_left(); st; 「弥」の三画目 †pen_down; Wait(100); move_up; Wait(time_b); st; turn_left(); Wait(100); move_up; Wait(time_c); st; turn_right(); Wait(100); move_up; Wait(time_d); move_right; Wait(90); st; Wait(100); move_up; Wait(time_e); move_stop; pen_up; Wait(200); 四画目までの移動 †move_down; Wait(time_e); st; move_left; Wait(120); repeat(2){ turn_left(); } st; Wait(100); move_up; Wait(time_b+time_b+time_d+20); move_stop; Wait(100); turn_right(); Wait(100); move_up; Wait(time_f); move_stop; Wait(100); move_right; Wait(100); st; Wait(200); 「弥」の四画目 †pen_down; Wait(100); move_up; Wait(time_g); move_stop; Wait(100); pen_up; Wait(100); 五画目までの移動 †move_down; Wait(50); st; Wait(100); move_left; Wait(100); st; Wait(200); 「弥」の五画目 †pen_down; Wait(100); move_up; Wait(time_h); st; pen_up; Wait(100); 六画目までの移動 †move_down; Wait(35); st; Wait(100); turn_right(); st; Wait(100); 「弥」の六画目 †pen_down; Wait(100); move_up; Wait(time_i); st; move_right; Wait(100); st; Wait(100); move_up; Wait(time_e); move_stop; pen_up; Wait(100); 七画目までの移動 †move_down; Wait(time_e); st; move_left; Wait(100); repeat(2) { turn_left() ; } Wait(100); move_up; Wait(80); st; turn_left(); Wait(100); move_up; Wait(50); st; move_left; Wait(70); st; Wait(100); 「弥」の七画目 †pen_down; Wait(100); move_up; Wait(time_j); move_stop; pen_up; 八画目までの移動 †Wait(100); move_down; Wait(time_j); st; move_right; Wait(70); repeat(2) { turn_right(); } Wait(100); move_up; Wait(100); st; move_right; Wait(70); st; Wait(100); 「弥」の八画目 †pen_down; Wait(100); move_up; Wait(time_j); move_stop; pen_up; 中心までの移動 †Wait(100); move_right; Wait(100); move_up; Wait(200); move_stop; } コメントお願いします。。。 |