SYSCONT_COURSWORK (780006), страница 2
Текст из файла (страница 2)
[1383] setcolor(LIGHTGRAY);
[1384] outtextxy(x-1,y-1," * ");
[1385] setcolor(LIGHTBLUE);
[1386] outtextxy(x-2,y-2," * ");
[1387] x=dx-30;
[1388] y=dy-40;
[1389] setcolor(LIGHTCYAN);
[1390] outtextxy(x,y," * ");
[1391] setcolor(LIGHTGRAY);
[1392] outtextxy(x-1,y-1," * ");
[1393] setcolor(LIGHTBLUE);
[1394] outtextxy(x-2,y-2," * ");
[1395] /*********************************************** Logic */
[1396] c_exe=(C2*4+C1*2+C0*1);
[1397] /*----*/
[1398] settextstyle(Font[7],HORIZ_DIR,4);
[1399] settextjustify(CENTER_TEXT,CENTER_TEXT);
[1400] setcolor(YELLOW);
[1401] x=dx/2;
[1402] y=dy/2+10;
[1403] if(c_exe==0)
[1404] {
[1405] setcolor(LIGHTBLUE);
[1406] outtextxy(x,y," Beethoven ~Sonata 17~ ");
[1407] setcolor(YELLOW);
[1408] outtextxy(x-1,y-1," Beethoven ~Sonata 17~ ");
[1409] /*
[1410] sonata17(MODERATO);
[1411] */
[1412] }
[1413] /*----*/
[1414] if(c_exe==1)
[1415] {
[1416] setcolor(
[1417] CYAN);
[1418] outtextxy(x,y," Beethoven ~Elise~ ");
[1419] setcolor(YELLOW);
[1420] outtextxy(x-1,y-1," Beethoven ~Elise~ ");
[1421] /*
[1422] elise(MODERATO);
[1423] */
[1424] }
[1425] return 0;
[1426] }
ПРОГРАММА РАБОТЫ УСТРОЙСТВА
АВТОПИЛОТ.
[1427] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1428] int Autopilote(int dx,int dy)
[1429] {
[1430] int x0=dx/2;
[1431] int y0=dy/2;
[1432] int a=7;
[1433] int r=dy/2-30;
[1434] int c_exe;
[1435] /*---- Viewport */
[1436] clearviewport();
[1437] /****************************** Compas */
[1438] /*---- NW-S0, NO-SW */
[1439] setcolor(LIGHTCYAN);
[1440] line(x0+(-r/1.41),y0+(r/1.41),x0+(r/1.41),y0+(-r/1.41));
[1441] line(x0+(-r/1.41),y0+(-r/1.41),x0+(r/1.41),y0+(r/1.41));
[1442] /*---- N, E, S, O */
[1443] setcolor(WHITE);
[1444] /*---- Nord */
[1445] line((x0-a),(y0-a),(x0),(y0-r));
[1446] line((x0+a),(y0-a),(x0),(y0-r));
[1447] /*---- Est */
[1448] line((x0+a),(y0-a),(x0+r),(y0));
[1449] line((x0+a),(y0+a),(x0+r),(y0));
[1450] /*---- Sud */
[1451] line((x0+a),(y0+a),(x0),(y0+r));
[1452] line((x0-a),(y0+a),(x0),(y0+r));
[1453] /*---- West */
[1454] line((x0-a),(y0+a),(x0-r),(y0));
[1455] line((x0-a),(y0-a),(x0-r),(y0));
[1456] /*---- Circle */
[1457] setcolor(LIGHTBLUE);
[1458] circle(x0,y0,r);
[1459] /*---- Center circle */
[1460] setcolor(WHITE);
[1461] ellipse
[1462] (dx/2,dy/2,0,360,6,6);
[1463] setfillstyle(SOLID_FILL,YELLOW);
[1464] floodfill(x0,y0,WHITE);
[1465] /*----*/
[1466] setfillstyle(SOLID_FILL,BLUE);
[1467] floodfill(x0-10,y0,WHITE);
[1468] /*---- N, O, S, W */
[1469] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_DRAFT+2);
[1470] /* setusercharsize(3,2,3,1); */
[1471] setcolor(WHITE);
[1472] settextjustify(CENTER_TEXT,BOTTOM_TEXT);
[1473] outtextxy(x0,y0-r-3," N ");
[1474] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1475] outtextxy(x0+r-3,y0-3," O ");
[1476] settextjustify(CENTER_TEXT,TOP_TEXT);
[1477] outtextxy(x0,y0+r," S ");
[1478] settextjustify(RIGHT_TEXT,CENTER_TEXT);
[1479] outtextxy(x0-r+3,y0," W ");
[1480] /*---- N0, NW, SO, SW */
[1481] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_DRAFT);
[1482] /* setusercharsize(3,2,3,1); */
[1483] setcolor(CYAN);
[1484] settextjustify(RIGHT_TEXT,CENTER_TEXT);
[1485] outtextxy(x0+(-r/1.41),y0+(-r/1.41)," NW ");
[1486] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1487] outtextxy(x0+(r/1.41),y0+(-r/1.41)," NO ");
[1488] settextjustify(RIGHT_TEXT,TOP_TEXT);
[1489] outtextxy(x0+(-r/1.41),y0+(r/1.41)," SW ");
[1490] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1491] outtextxy(x0+(r/1.41),y0+(r/1.41)," SO ");
[1492] /****************************** Logic */
[1493] c_exe=(C2*4+C1*2+C0*1);
[1494] setcolor(YELLOW
[1495] );
[1496] setlinestyle(SOLID_LINE,0,THICK_WIDTH);
[1497] r=r-10;
[1498] /*---- Cours 0 */
[1499] if(c_exe==0)
[1500] {
[1501] moveto(x0,y0);
[1502] linerel(0,-r);
[1503] }
[1504] /*---- Cours 45 */
[1505] if(c_exe==1)
[1506] {
[1507] moveto(x0,y0);
[1508] linerel(r/1.41,-r/1.41);
[1509] }
[1510] /*---- Cours 90 */
[1511] if(c_exe==2)
[1512] {
[1513] moveto(x0,y0);
[1514] linerel(r,0);
[1515] }
[1516] /*---- Cours 135 */
[1517] if(c_exe==3)
[1518] {
[1519] moveto(x0,y0);
[1520] linerel(r/1.41,r/1.41);
[1521] }
[1522] /*---- Cours 180 */
[1523] if(c_exe==4)
[1524] {
[1525] moveto(x0,y0);
[1526] linerel(0,r);
[1527] }
[1528] /*---- Cours 225 */
[1529] if(c_exe==5)
[1530] {
[1531] moveto(x0,y0);
[1532] linerel(-r/1.41,r/1.41);
[1533] }
[1534] /*---- Cours 270 */
[1535] if(c_exe==6)
[1536] {
[1537] moveto(x0,y0);
[1538] linerel(-r,0);
[1539] }
[1540] /*---- Cours 315 */
[1541] if(c_exe==7)
[1542] {
[1543] moveto(x0,y0);
[1544] linerel(-r/1.41,-r/1.41);
[1545] }
[1546] /*----*/
[1547] return 0;
[1548] }
[1549] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
16















