Desain Rumah Sederhana
Langkah - Langkah Membuatnya:
1. Buka Dev C++ > New Project
2. Project Options > Pilih Compiler > Base Compiler Set: TDM-GCC 4.9.2 32-bit Release
3. Pilih Parameter > Masukkan Linker Berikut:
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
Didalam Kolom Linker > Klik Ok
4. Silahkan Copy-Paste Script Program Dibawah Ini Ke Project Baru Anda:
6. Sekian Dan Terima Kasih
#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include <conio.h>
int main()
{
int radius;
initwindow(1000,700,"Pemandangan",0,0);
setfillstyle(SOLID_FILL,LIGHTCYAN); //LATAR
bar(0, 0, 1000, 350);
setfillstyle(SOLID_FILL,GREEN);
bar(0, 350, 1000, 700);
circle(0,0, 75); //Matahari
setfillstyle(SOLID_FILL,YELLOW);
floodfill(0,0,WHITE);
circle(900,50,30); //Awan
setfillstyle(SOLID_FILL,WHITE);
floodfill(900,50,WHITE);
circle(950,45,40);
setfillstyle(SOLID_FILL,WHITE);
floodfill(950,50,WHITE);
circle(870,45,20);
setfillstyle(SOLID_FILL,WHITE);
floodfill(870,40,WHITE);
setfillstyle(SOLID_FILL,WHITE); //Dinding 1
bar(15,270,805,685);
setcolor(BLACK); //Garis Dinding 1
rectangle(14,269,510,685);
setfillstyle(SOLID_FILL,RED); //Frame Merah 1
bar(15,290,510,685);
setfillstyle(SOLID_FILL,WHITE); //Dinding 2
bar(25,300,500,675);
setfillstyle(INTERLEAVE_FILL,BLUE); //Kusen jendela 1
pieslice(139,420,0,180,51);
setfillstyle(INTERLEAVE_FILL,GREEN);
pieslice(139,415,0,180,41);
setfillstyle(INTERLEAVE_FILL,BLUE);
pieslice(250,420,0,180,50);
setfillstyle(INTERLEAVE_FILL,GREEN);
pieslice(250,415,0,180,40);
setfillstyle(SOLID_FILL,BLUE); //Latar Jendela 1
bar(80,430,305,610);
setcolor(BLACK); //Jendela 1
setfillstyle(SOLID_FILL,LIGHTCYAN);
bar(90,440,190,600);
setcolor(BLACK); //Jendela 2
setfillstyle(SOLID_FILL,LIGHTCYAN);
bar(200,440,295,600);
setfillstyle(INTERLEAVE_FILL,RED); //Kusen pintu
pieslice(413,420,0,180,65);
setfillstyle(INTERLEAVE_FILL,YELLOW);
pieslice(413,412,0,180,47);
setcolor(BLACK); //Pintu
rectangle(349,429,475,655);
setfillstyle(SOLID_FILL,RED);
bar(350,430,475,655);
setfillstyle(SOLID_FILL,YELLOW);
bar(360,440,465,645);
setcolor(BLACK);
for(int j=360; j<=465; j=j+18)
{ line(j,440,j,645); }
setfillstyle(SOLID_FILL,RED); //Gagang Pintu
for ( radius = 1; radius <= 7 ; radius = radius + 1)
{circle(370,535, radius);}
setfillstyle(SOLID_FILL,RED); //Frame Merah 2
bar(511,290,805,685);
setfillstyle(SOLID_FILL,WHITE); //Dinding 2
bar(520,300,795,675);
setcolor(BLACK); //Garis Dinding 2
rectangle(510,260,805,685);
setfillstyle(INTERLEAVE_FILL,BLUE); //Kusen jendela 2
pieslice(605,420,0,180,51);
setfillstyle(INTERLEAVE_FILL,GREEN);
pieslice(605,415,0,180,41);
setfillstyle(INTERLEAVE_FILL,BLUE);
pieslice(715,420,0,180,50);
setfillstyle(INTERLEAVE_FILL,GREEN);
pieslice(715,415,0,180,40);
setcolor(BLACK); //Latar Jendela 2
setfillstyle(SOLID_FILL,BLUE);
bar(545,430,770,610);
setcolor(BLACK); //Jendela 3
setfillstyle(SOLID_FILL,LIGHTCYAN);
bar(555,440,655,600);
setcolor(BLACK); //Jendela 4
setfillstyle(SOLID_FILL,LIGHTCYAN);
bar(665,440,760,600);
setcolor(DARKGRAY); //Atap 1
for(int i=485; i<=830; i++)
{ line(i,269,660,90); }
setcolor(WHITE); //Atap 2
for(int i=511; i<=805;i++)
{ line(i,270,660,120); }
setcolor(RED); //Lingkaran tengah
setfillstyle(SOLID_FILL,RED);
for ( radius = 1; radius <= 25 ; radius = radius + 1)
{ circle(660,220, radius); }
setcolor(RED); //Atap 3
for(int i=5; i<=485; i++)
{ line(i,269,660,90); }
for(int i=200; i<=660; i++)
{ line(5,269,i,90); }
getch();
closegraph();
return 0;
}
5. Kemudian Save Dan Tekan F116. Sekian Dan Terima Kasih
Related Posts
Subscribe Our Newsletter
Belum ada Komentar untuk "Tutorial Desain Rumah Sederhana Dengan Dev C++"
Posting Komentar