2015a/Member/morinokumasan/Mission1/program
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[2015a/Member/morinokumasan/Mission1]]
void XbackYforward(int t) //左上
{
OnRev(OUT_B);
OnFwd(OUT_A);
Wait(t);
Off(OUT_AB);
}
void XbackYback(int t) //左下
{
OnRev(OUT_AB);
Wait(t);
Off(OUT_AB);
}
void XforwardYforward(int t) //右上
{
OnFwd(OUT_AB);
Wait(t);
Off(OUT_AB);
}
void XforwardYback(int t) //右下
{
OnRev(OUT_A);
OnFwd(OUT_B);
Wait(t);
Off(OUT_AC);
}
void Yforward(int t) //上
{
OnFwd(OUT_A);
Wait(t);
Off(OUT_A);
}
void Yback(int t) //下
{
OnRev(OUT_A);
Wait(t);
Off(OUT_A);
}
void Xforward(int t) //右
{
OnFwd(OUT_B);
Wait(t);
Off(OUT_B);
}
void Xback(int t) //左
{
OnRev(OUT_B);
Wait(t);
Off(OUT_B);
}
void writeon() //書き始め
{
OnFwd(OUT_C);
Wait(5);
Off(OUT_C);
}
void writeoff() //書き終わり
{
OnRev(OUT_C);
Wait(5);
Off(OUT_C);
}
#define movetime 8 //1辺の長さ
task main ()
{
//ム
writeon();
XbackYback(movetime*3);
Xforward(movetime*5);
writeoff();
XbackYforward(movetime);
writeon();
XforwardYback(movetime*2);
writeoff();
Yback(movetime*9);
Xback(movetime);
//月
writeon();
Yforward(movetime*8);
Xback(movetime*4);
Yback(movetime*8);
writeoff();
Yforward(movetime*4);
writeon();
Xforward(movetime*4);
writeoff();
Yforward(movetime*2);
writeon();
Xback(movetime*4);
writeoff();
Xforward(movetime*6);
//ヒ2つ
writeon();
Yback(movetime*6);
Xforward(movetime*4);
writeoff();
Yforward(movetime*6);
writeon();
XbackYback(movetime*4);
writeoff();
Yforward(movetime*12);
writeon();
Yback(movetime*6);
Xforward(movetime*4);
writeoff();
Yforward(movetime*6);
writeon();
XbackYback(movetime*4);
writeoff();
Yback(movetime*11);
Xback(movetime*5);
//点4つ
writeon();
XbackYback(movetime*2);
writeoff();
Xforward(movetime*6);
repeat(3){
writeon();
XbackYforward(movetime*2);
writeoff();
Xforward(movetime*4);
Yback(movetime*2);
}
}
終了行:
[[2015a/Member/morinokumasan/Mission1]]
void XbackYforward(int t) //左上
{
OnRev(OUT_B);
OnFwd(OUT_A);
Wait(t);
Off(OUT_AB);
}
void XbackYback(int t) //左下
{
OnRev(OUT_AB);
Wait(t);
Off(OUT_AB);
}
void XforwardYforward(int t) //右上
{
OnFwd(OUT_AB);
Wait(t);
Off(OUT_AB);
}
void XforwardYback(int t) //右下
{
OnRev(OUT_A);
OnFwd(OUT_B);
Wait(t);
Off(OUT_AC);
}
void Yforward(int t) //上
{
OnFwd(OUT_A);
Wait(t);
Off(OUT_A);
}
void Yback(int t) //下
{
OnRev(OUT_A);
Wait(t);
Off(OUT_A);
}
void Xforward(int t) //右
{
OnFwd(OUT_B);
Wait(t);
Off(OUT_B);
}
void Xback(int t) //左
{
OnRev(OUT_B);
Wait(t);
Off(OUT_B);
}
void writeon() //書き始め
{
OnFwd(OUT_C);
Wait(5);
Off(OUT_C);
}
void writeoff() //書き終わり
{
OnRev(OUT_C);
Wait(5);
Off(OUT_C);
}
#define movetime 8 //1辺の長さ
task main ()
{
//ム
writeon();
XbackYback(movetime*3);
Xforward(movetime*5);
writeoff();
XbackYforward(movetime);
writeon();
XforwardYback(movetime*2);
writeoff();
Yback(movetime*9);
Xback(movetime);
//月
writeon();
Yforward(movetime*8);
Xback(movetime*4);
Yback(movetime*8);
writeoff();
Yforward(movetime*4);
writeon();
Xforward(movetime*4);
writeoff();
Yforward(movetime*2);
writeon();
Xback(movetime*4);
writeoff();
Xforward(movetime*6);
//ヒ2つ
writeon();
Yback(movetime*6);
Xforward(movetime*4);
writeoff();
Yforward(movetime*6);
writeon();
XbackYback(movetime*4);
writeoff();
Yforward(movetime*12);
writeon();
Yback(movetime*6);
Xforward(movetime*4);
writeoff();
Yforward(movetime*6);
writeon();
XbackYback(movetime*4);
writeoff();
Yback(movetime*11);
Xback(movetime*5);
//点4つ
writeon();
XbackYback(movetime*2);
writeoff();
Xforward(movetime*6);
repeat(3){
writeon();
XbackYforward(movetime*2);
writeoff();
Xforward(movetime*4);
Yback(movetime*2);
}
}
ページ名: