#include <GRAPHICS.H>
#include <conio.h>
const double alpha=10;
void spirala(double lg,double x,double y)
{
if (lg>0)
{
lineto(x+lg,y);
lineto(x+lg,y+lg);
lineto(x+alpha,y+lg);
lineto(x+alpha,y+alpha);
spirala(lg-2*alpha,x+alpha,y+alpha);
}
}
int main()
{
int Karta, Tryb;
Karta = DETECT;
initgraph(&Karta, &Tryb, "c:\\tc\\bgi\\");
setgraphmode(Tryb);
moveto(90,50);
spirala(getmaxx()/2,getx(),gety());
getch();
closegraph();
}
[c++] spirala
Rozpoczęty przez
norbi123
, 13 08 2008 01:09
4 odpowiedzi w tym temacie
#1
Napisano 13 08 2008 - 01:09
napisalem program ktory ma narysowac spiral ale nie wiem czemu nie chce jej rysowac prosze pomoc w poprawieniu kodu
#2
Napisano 13 08 2008 - 17:27
Ani bibliotek nie zamieściłeś, ani błędu jaki otrzymujesz. Pomógłbym Ci, gdybyś to zrobił, albo nie używał takiego gó**a jak Borlandowskie IDE.
#3
Napisano 14 08 2008 - 21:41
Podejrzewam że to źródło które podałeś masz z tej strony:
http://www.ujk.kielce.pl//informatyka/medi..._rekurencja.htm
Jakie masz błędy podczas kompilacji ? - Myślę że tutaj jest problem.Podaj więcej szczegółów.
http://www.ujk.kielce.pl//informatyka/medi..._rekurencja.htm
Jakie masz błędy podczas kompilacji ? - Myślę że tutaj jest problem.Podaj więcej szczegółów.
#4
Napisano 15 08 2008 - 01:07
błedy podczas kompilacji to
z tego co widze chyba nie mam "GRAPHICS.H" tej biblioteki
G:\by norbi123\helion\2\algo3\SPIRALA.CPP|3|GRAPHICS.H: No such file or directory| G:\by norbi123\helion\2\algo3\SPIRALA.CPP||In function `void spirala(double, double, double)':| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|12|error: `lineto' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|12|error: (Each undeclared identifier is reported only once for each function it appears in.)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP||In function `int main()':| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|22|error: `DETECT' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|23|error: `initgraph' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|24|error: `setgraphmode' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|25|error: `moveto' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|26|error: `getmaxx' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|26|error: `getx' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|26|error: `gety' undeclared (first use this function)| G:\by norbi123\helion\2\algo3\SPIRALA.CPP|28|error: `closegraph' undeclared (first use this function)| ||=== Build finished: 11 errors, 0 warnings ===|
z tego co widze chyba nie mam "GRAPHICS.H" tej biblioteki
Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych



Temat jest zamknięty





