[ ภาษา C ] รูปหนู วาดด้วยภาษา C


งานนี้ ทำเมื่อเทอมก่อน ครับ ในวิชา การเขียนโปรแกรมภาษา C++
อาจารย์ให้เขียน Code วาดรูปในภาษาซี ครับ
*จากรูปที่เห็นอยู่ด้านล่าง ก็คือ รูปที่ผมทำส่งครับ ใช้ graphic mode ครับ เขียนด้วยโปรแกรม Turbo C++ (TC) และเนื่องจากผมใช้ Windows 7 x64 ทำให้เขียนไม่ได้ ผมจึงได้ใช้โปรแกรมจำลอง OS windows xp  แล้วเข้าไปเขียน ครับ

271112_1826050853892_1318894894_31545106_3871779_n

Code : (เอาไปดู หรือเอาไปใช้ ก็ช่วย แสดงความเห็น หรือขอบคุณกันบ้างนะครับ)

// Design By Bggaro
#include<conio.h>
#include<graphics.h>
void main()
{
clrscr();

int driver,mode;
driver=DETECT;
mode=0;
initgraph(&driver,&mode,"");

setfillstyle(1,15);
floodfill(100,100,1);
//b0-1
setcolor(8);
ellipse(230,170,10,125,100,100);
ellipse(230,170,10,125,99,99);
ellipse(230,170,10,125,98,98);
ellipse(230,170,10,125,97,97);
ellipse(230,170,10,125,96,96);
ellipse(230,170,10,125,95,95);
ellipse(230,170,10,125,94,94);
ellipse(230,170,10,125,93,93);
ellipse(230,170,10,125,92,92);
ellipse(230,170,10,125,91,91);
ellipse(230,170,10,125,90,90);
//
ellipse(118,34,0,360,5,5);
setfillstyle(SOLID_FILL,8);
floodfill(118,34,8);
//b0-2
ellipse(160,50,160,290,40,40);
ellipse(160,50,160,290,41,41);
ellipse(160,50,160,290,42,42);
ellipse(160,50,160,290,43,43);
ellipse(160,50,160,290,44,44);
ellipse(160,50,160,290,45,45);
ellipse(160,50,160,290,46,46);
ellipse(160,50,160,290,47,47);
ellipse(160,50,160,290,48,48);
ellipse(160,50,160,290,49,49);
ellipse(160,50,160,290,50,50);

//b1
setcolor(0);
ellipse(320,250,8,171,100,100);
ellipse(320,250,8,171,101,101);
ellipse(320,250,8,171,102,102);
ellipse(320,250,8,171,103,103);

ellipse(250,270,0,290,45,45);
ellipse(250,270,0,290,46,46);
ellipse(250,270,0,290,47,47);
ellipse(250,270,0,290,48,48);

ellipse(390,270,250,180,45,45);
ellipse(390,270,250,180,46,46);
ellipse(390,270,250,180,47,47);
ellipse(390,270,250,180,48,48);

ellipse(320,380,220,320,28,30);
ellipse(320,380,220,320,29,31);
ellipse(320,380,220,320,30,32);
ellipse(320,380,220,320,31,33);

line(299,400,250,314);
line(298,400,249,314);
line(297,400,248,314);
line(296,400,247,314);

line(341,400,390,313);
line(342,400,391,313);
line(343,400,392,313);
line(344,400,393,313);

setfillstyle(SOLID_FILL,7);
floodfill(390,270,0);

//h-L
setcolor(8);
ellipse(250,270,17,210,37,37);
ellipse(258,290,47,178,40,40);
setfillstyle(SOLID_FILL,8);
floodfill(230,250,8);

//h-R
setcolor(8);
ellipse(390,270,-30,172,37,37);
ellipse(381,292,5,133,40,40);
setfillstyle(SOLID_FILL,8);
floodfill(395,245,8);

//eye1
setcolor(0);
ellipse(300,340,0,360,7,10);
setfillstyle(SOLID_FILL,0);
floodfill(300,340,0);

//eye1-2
setcolor(15);
ellipse(301,339,0,360,1,3);
setfillstyle(SOLID_FILL,15);
floodfill(301,339,15);

//eye2
setcolor(0);
ellipse(340,340,0,360,7,10);
setfillstyle(SOLID_FILL,0);
floodfill(340,340,0);

//eye1-2
setcolor(15);
ellipse(339,339,0,360,1,3);
setfillstyle(SOLID_FILL,15);
floodfill(339,339,15);

//3point
setcolor(0);
line(310,380,330,380);
line(310,380,320,390);
line(320,390,330,380);
setfillstyle(SOLID_FILL,0);
floodfill(320,385,0);

//l-line-L
setcolor(0);
line(230,370,300,380);
line(231,371,301,381);

line(235,390,302,384);
line(236,391,303,385);

line(240,415,306,387);
line(241,415,307,387);

//l-line-R
line(337,380,400,370);
line(336,379,399,369);

line(335,384,400,385);
line(334,383,399,384);

line(333,387,400,400);
line(333,386,399,399);

setcolor(1);
line(0,440,650,440);
line(0,441,650,441);

setcolor(6);
outtextxy(10,450,"Mr Jirawat Kaewlo");
outtextxy(10,465,"No.53162940103");

setcolor(2);
outtextxy(500,455,"Design By Bggaro");

settextstyle(0,0,3);
setcolor(10);
outtextxy(400,100,"Weed!!!");
outtextxy(430,150,"Weed!!!!!");

settextstyle(0,0,1);
setcolor(12);
outtextxy(0,0,"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");

//circle(50,100,25);

getch();
closegraph();
  }

จะมี อยู่บันทัดหนึ่ง ที่อาจขึ้น เออเรอร์
outtextxy(0,0,“@@@@@@@@@@@@ ฯ
เพราะผมตัดขึ้นบรรทัดใหม่ เนิ่องจากมันล้นหน้าเว็บ ครับ

—————

By Bggaro Film

About Bggaro

รับงานถ่ายรูป/ถ่ายวีดีโอ/ออกแบบเว็บไซต์/สื่อการสอน/วิทยากร (สุรินทร์ ช่างภาพ)

Posted on ธันวาคม 3, 2011, in โปรแกรม and tagged , , . Bookmark the permalink. 24 ความเห็น.

  1. #include

    #include

    void main()

    {

    clrscr();

    int driver,mode;

    driver=DETECT;

    mode=0;

    initgraph(&driver,&mode,”c:\\tc\\bgi”);

    setfillstyle(1,15);

    floodfill(100,100,1);

    //b0-1

    setcolor(8);

    ellipse(230,170,10,125,100,100);

    ellipse(230,170,10,125,99,99);

    ellipse(230,170,10,125,98,98);

    ellipse(230,170,10,125,97,97);

    ellipse(230,170,10,125,96,96);

    ellipse(230,170,10,125,95,95);

    ellipse(230,170,10,125,94,94);

    ellipse(230,170,10,125,93,93);

    ellipse(230,170,10,125,92,92);

    ellipse(230,170,10,125,91,91);

    ellipse(230,170,10,125,90,90);

    //

    ellipse(118,34,0,360,5,5);

    setfillstyle(SOLID_FILL,8);

    floodfill(118,34,8);

    //b0-2

    ellipse(160,50,160,290,40,40);

    ellipse(160,50,160,290,41,41);

    ellipse(160,50,160,290,42,42);

    ellipse(160,50,160,290,43,43);

    ellipse(160,50,160,290,44,44);

    ellipse(160,50,160,290,45,45);

    ellipse(160,50,160,290,46,46);

    ellipse(160,50,160,290,47,47);

    ellipse(160,50,160,290,48,48);

    ellipse(160,50,160,290,49,49);

    ellipse(160,50,160,290,50,50);

    //b1

    setcolor(0);

    ellipse(320,250,8,171,100,100);

    ellipse(320,250,8,171,101,101);

    ellipse(320,250,8,171,102,102);

    ellipse(320,250,8,171,103,103);

    ellipse(250,270,0,290,45,45);

    ellipse(250,270,0,290,46,46);

    ellipse(250,270,0,290,47,47);

    ellipse(250,270,0,290,48,48);

    ellipse(390,270,250,180,45,45);

    ellipse(390,270,250,180,46,46);

    ellipse(390,270,250,180,47,47);

    ellipse(390,270,250,180,48,48);

    ellipse(320,380,220,320,28,30);

    ellipse(320,380,220,320,29,31);

    ellipse(320,380,220,320,30,32);

    ellipse(320,380,220,320,31,33);

    line(299,400,250,314);

    line(298,400,249,314);

    line(297,400,248,314);

    line(296,400,247,314);

    line(341,400,390,313);

    line(342,400,391,313);

    line(343,400,392,313);

    line(344,400,393,313);

    setfillstyle(SOLID_FILL,7);

    floodfill(390,270,0);

    //h-L

    setcolor(8);

    ellipse(250,270,17,210,37,37);

    ellipse(258,290,47,178,40,40);

    setfillstyle(SOLID_FILL,8);

    floodfill(230,250,8);

    //h-R

    setcolor(8);

    ellipse(390,270,-30,172,37,37);

    ellipse(381,292,5,133,40,40);

    setfillstyle(SOLID_FILL,8);

    floodfill(395,245,8);

    //eye1

    setcolor(0);

    ellipse(300,340,0,360,7,10);

    setfillstyle(SOLID_FILL,0);

    floodfill(300,340,0);

    //eye1-2

    setcolor(15);

    ellipse(301,339,0,360,1,3);

    setfillstyle(SOLID_FILL,15);

    floodfill(301,339,15);

    //eye2

    setcolor(0);

    ellipse(340,340,0,360,7,10);

    setfillstyle(SOLID_FILL,0);

    floodfill(340,340,0);

    //eye1-2

    setcolor(15);

    ellipse(339,339,0,360,1,3);

    setfillstyle(SOLID_FILL,15);

    floodfill(339,339,15);

    //3point

    setcolor(0);

    line(310,380,330,380);

    line(310,380,320,390);

    line(320,390,330,380);

    setfillstyle(SOLID_FILL,0);

    floodfill(320,385,0);

    //l-line-L

    setcolor(0);

    line(230,370,300,380);

    line(231,371,301,381);

    line(235,390,302,384);

    line(236,391,303,385);

    line(240,415,306,387);

    line(241,415,307,387);

    //l-line-R

    line(337,380,400,370);

    line(336,379,399,369);

    line(335,384,400,385);

    line(334,383,399,384);

    line(333,387,400,400);

    line(333,386,399,399);

    setcolor(1);

    line(0,440,650,440);

    line(0,441,650,441);

    setcolor(6);

    outtextxy(10,450,”Mr Jirawat Kaewlo”);

    outtextxy(10,465,”No.53162940103″);

    setcolor(2);

    outtextxy(500,455,”Design By Bggaro”);

    settextstyle(0,0,3);

    setcolor(10);

    outtextxy(400,100,”Weed!!!”);

    outtextxy(430,150,”Weed!!!!!”);

    settextstyle(0,0,1);

    setcolor(12);

    getch();

    closegraph();

    }

  1. Pingback: เตือนภัย! การระวังพวกชอบแท็กรูปโฆษณา | kunakorn2000

  2. Pingback: ทฤษฎี/แนวคิด | kunakorn2000

แสดงความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

ติดตาม

Get every new post delivered to your Inbox.

%d bloggers like this: